diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 945ec2d..0fe7419 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -30,12 +30,11 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v6 - - uses: actions/setup-python@v6 + - run: sudo apt install gettext -y + - uses: astral-sh/setup-uv@v7 with: python-version: ${{ matrix.python-version }} - - run: sudo apt install gettext -y - - run: python -m pip install .[test] - - run: python -m pytest + - run: uv run --no-dev --group=test pytest - uses: codecov/codecov-action@v6 with: token: ${{ secrets.CODECOV_TOKEN }} diff --git a/.gitignore b/.gitignore index 1fd15d0..cbe3654 100644 --- a/.gitignore +++ b/.gitignore @@ -162,3 +162,6 @@ cython_debug/ # flit-scm _version.py + +# UV +uv.lock diff --git a/pyproject.toml b/pyproject.toml index 4964d5f..990b513 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,19 +31,25 @@ classifiers = [ ] requires-python = ">=3.10" dependencies = [ - "flit-core~=3.5", + "flit-core~=3.12", ] [project.optional-dependencies] +scm = [ + "flit-scm", +] + +[dependency-groups] +dev = [ + { include-group = "test" }, +] test = [ "pytest", "pytest-cov", "flit-scm", "build", "wheel", -] -scm = [ - "flit-scm", + "pip", ] [project.urls] diff --git a/tests/conftest.py b/tests/conftest.py index 5165822..42d6a3c 100644 --- a/tests/conftest.py +++ b/tests/conftest.py @@ -5,6 +5,8 @@ import pytest +PACKAGE_DIR = Path(__file__).parent.parent + @pytest.fixture def package(): @@ -17,7 +19,7 @@ def package(): 'version = "0.1.0"\n' 'description = "A package"\n' "[build-system]\n" - 'requires = ["flit_core >=3.0.0,<4"]\n' + f'requires = ["flit_core >=3.0.0,<4", "{PACKAGE_DIR}"]\n' 'build-backend = "flit_gettext.core"\n' ) (temp_dir / "package").mkdir(parents=True) @@ -38,7 +40,7 @@ def package_scm(): 'description = "A package"\n' 'dynamic = ["version"]\n' "[build-system]\n" - 'requires = ["flit_core >=3.0.0,<4", "flit_scm"]\n' + f'requires = ["flit_core >=3.0.0,<4", "flit_scm", "{PACKAGE_DIR}"]\n' 'build-backend = "flit_gettext.scm"\n' "[tool.setuptools_scm]\n" 'write_to = "package/_version.py"\n'