diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index c048d875..53375c46 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,18 +36,9 @@ jobs: extra_deps: ['"--with=pytest==8.3.3" "--with=pydantic<2"', '"--with=pytest>=8.3.4" "--with=pydantic>2"'] steps: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 - - - name: Install uv - uses: astral-sh/setup-uv@v5 - with: - python-version: ${{matrix.python-version}} - - - name: Set up Python - uses: actions/setup-python@0b93645e9fea7318ecaed2b359559ac225c90a2b # v5.3.0 + - uses: ./.github/actions/setup with: python-version: ${{matrix.python-version}} - architecture: x64 - allow-prereleases: true - run: | uv run ${{matrix.extra_deps}} duty test ${{ matrix.os == 'ubuntu-latest' && 'coverage=True' }} diff --git a/pyproject.toml b/pyproject.toml index 90add546..c9b4aff7 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -39,6 +39,24 @@ readme = "README.md" requires-python = ">=3.8" version = "0.18.1" +[dependency-groups] +dev = [ + "duty>=1.4.2", + "hypothesis>=6.75.5", + "mypy>=1.2.0", + "pyright>=1.1.359", + "pytest-subtests>=0.11.0", + "pytest-freezer>=0.4.8", + "pytest-mock>=3.14.0", + "pytest-xdist>=3.6.1", + "coverage[toml]>=7.6.1", + "coverage-enable-subprocess>=1.0", + "pytest>=8.3.4", + "dirty-equals>=0.7.0", + "attrs>=24.3.0", + "pydantic>=1", +] + [project.entry-points.pytest11] inline_snapshot = "inline_snapshot.pytest_plugin" @@ -97,51 +115,6 @@ serve = "mkdocs serve" dependencies=["cogapp","lxml","requests"] scripts.update="cog -r docs/**.md" -[[tool.hatch.envs.hatch-test.matrix]] -python = ["3.13", "3.12", "3.11", "3.10", "3.9", "3.8","pypy3.9","pypy3.10"] -pytest=["8.3.3","8.3.4"] - -[tool.hatch.envs.hatch-test.overrides] -matrix.pytest.dependencies = [ - { value = "pytest==8.3.3", if = ["8.3.3"] }, - { value = "pytest>=8.3.4", if = ["8.3.4"] }, -] - - -[tool.hatch.envs.hatch-test] -# Info for everyone who packages this library: -# The following dependencies are installed with uv if you run `pytest --use-uv` -# and used for specific tests in specific versions: -# - pydantic v1 & v2 -# - attrs -# But you dont have to use uv to test this library. -# You can also just install the dependencies and use `pytest` normally -extra-dependencies = [ - "dirty-equals>=0.7.0", - "hypothesis>=6.75.5", - "mypy>=1.2.0", - "pyright>=1.1.359", - "pytest-subtests>=0.11.0", - "pytest-freezer>=0.4.8", - "pytest-mock>=3.14.0" -] -env-vars.TOP = "{root}" - -[tool.hatch.envs.hatch-test.scripts] -run = "pytest{env:HATCH_TEST_ARGS:} --use-uv {args}" -run-cov = "coverage run -m pytest{env:HATCH_TEST_ARGS:} --use-uv {args}" -cov-combine = "coverage combine" -cov-report=["coverage report","coverage html"] - -[tool.hatch.envs.types] -extra-dependencies = [ - "mypy>=1.0.0", - "pytest", - "hypothesis>=6.75.5", - "pydantic", - "attrs" -] - [tool.hatch.envs.release] detached=true dependencies=[ @@ -181,21 +154,3 @@ version = "command: cz bump --get-next" [tool.pytest.ini_options] markers=["no_rewriting: marks tests which need no code rewriting and can be used with pypy"] - -[dependency-groups] -dev = [ - "duty>=1.4.2", - "hypothesis>=6.75.5", - "mypy>=1.2.0", - "pyright>=1.1.359", - "pytest-subtests>=0.11.0", - "pytest-freezer>=0.4.8", - "pytest-mock>=3.14.0", - "pytest-xdist>=3.6.1", - "coverage[toml]>=7.6.1", - "coverage-enable-subprocess>=1.0", - "pytest>=8.3.4", - "dirty-equals>=0.7.0", - "attrs>=24.3.0", - "pydantic>=1", -]