diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 3d725a50..c79c0de8 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -2,13 +2,7 @@ version: 2 updates: - package-ecosystem: pip - directory: /dependencies/default - schedule: - interval: weekly - open-pull-requests-limit: 10 - target-branch: main -- package-ecosystem: pip - directory: /dependencies/docs + directory: / schedule: interval: weekly open-pull-requests-limit: 10 diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 14e2361d..f55f1d27 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -16,8 +16,8 @@ env: PYTHON_LATEST: 3.13 jobs: - lint: - name: Run linters + build: + name: Build package runs-on: ubuntu-latest outputs: version: ${{ steps.version.outputs.version }} @@ -30,23 +30,12 @@ jobs: - uses: actions/setup-python@v5 with: python-version: ${{ env.PYTHON_LATEST }} - - name: Install GitHub matcher for ActionLint checker - run: | - echo "::add-matcher::.github/actionlint-matcher.json" - - name: Install pre-commit - run: python -m pip install pre-commit - - name: Run pre-commit checks - run: pre-commit run --all-files --show-diff-on-failure - - name: Install check-wheel-content, and twine - run: python -m pip install build check-wheel-contents twine - - name: Build package - run: python -m build + - name: Install tox + run: python -m pip install tox + - name: Build package and check distributions + run: tox run -e build - name: List result run: ls -l dist - - name: Check wheel contents - run: check-wheel-contents dist/*.whl - - name: Check long_description - run: python -m twine check dist/* - name: Install pytest-asyncio run: pip install . - name: Get version info @@ -58,6 +47,25 @@ jobs: name: dist path: dist + lint: + name: Run linters + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v5 + with: + fetch-depth: 0 + persist-credentials: false + - uses: actions/setup-python@v5 + with: + python-version: ${{ env.PYTHON_LATEST }} + - name: Install GitHub matcher for ActionLint checker + run: | + echo "::add-matcher::.github/actionlint-matcher.json" + - name: Install pre-commit + run: python -m pip install pre-commit + - name: Run pre-commit checks + run: pre-commit run --all-files --show-diff-on-failure + test: name: ${{ matrix.os }} - Python ${{ matrix.python-version }} runs-on: ${{ matrix.os }}-latest @@ -109,7 +117,7 @@ jobs: check: name: Check if: always() - needs: [lint, test] + needs: [build, lint, test] runs-on: ubuntu-latest steps: - name: Decide whether the needed jobs succeeded or failed @@ -145,7 +153,7 @@ jobs: create-github-release: name: Create GitHub release - needs: [lint, check] + needs: [build, lint, check] runs-on: ubuntu-latest permissions: contents: write @@ -168,7 +176,7 @@ jobs: if: ${{ !contains(github.ref, 'refs/tags/') }} run: towncrier build --draft --version "${version}" > release-notes.rst env: - version: ${{ needs.lint.outputs.version }} + version: ${{ needs.build.outputs.version }} - name: Extract release notes from Git tag if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') run: | @@ -194,16 +202,16 @@ jobs: if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') uses: ncipollo/release-action@bcfe5470707e8832e12347755757cec0eb3c22af # v1.18.0 with: - name: pytest-asyncio ${{ needs.lint.outputs.version }} + name: pytest-asyncio ${{ needs.build.outputs.version }} artifacts: dist/* bodyFile: release-notes.md - prerelease: ${{ needs.lint.outputs.prerelease }} + prerelease: ${{ needs.build.outputs.prerelease }} token: ${{ secrets.GITHUB_TOKEN }} publish-test-pypi: name: Publish packages to test.pypi.org if: github.event_name == 'push' && github.ref == 'refs/heads/main' - needs: [lint, check] + needs: [build, lint, check] runs-on: ubuntu-latest permissions: id-token: write @@ -222,7 +230,7 @@ jobs: name: Publish packages to pypi.org environment: release if: github.event_name == 'push' && contains(github.ref, 'refs/tags/') - needs: [lint, check] + needs: [build, lint, check] runs-on: ubuntu-latest permissions: id-token: write diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 16938eaa..77dc1773 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -72,7 +72,7 @@ repos: hooks: - id: pyproject-fmt # https://pyproject-fmt.readthedocs.io/en/latest/#calculating-max-supported-python-version - additional_dependencies: [tox>=4.9] + additional_dependencies: [tox>=4.28] - repo: https://github.com/zizmorcore/zizmor-pre-commit rev: v1.12.1 hooks: diff --git a/changelog.d/+dc5bb56e.downstream.rst b/changelog.d/+dc5bb56e.downstream.rst new file mode 100644 index 00000000..6bb210bb --- /dev/null +++ b/changelog.d/+dc5bb56e.downstream.rst @@ -0,0 +1 @@ +Bump the minimum required version of tox to v4.28. This change is only relevant if you use the ``tox.ini`` file provided by pytest-asyncio to run tests. diff --git a/constraints.txt b/constraints.txt new file mode 100644 index 00000000..0e696c64 --- /dev/null +++ b/constraints.txt @@ -0,0 +1,66 @@ +alabaster==0.7.16 +annotated-types-0.7.0 +attrs==25.3.0 +babel==2.17.0 +backports.asyncio.runner==1.2.0 +backports.tarfile==1.2.0 +certifi==2025.8.3 +charset-normalizer==3.4.3 +check-wheel-contents==0.6.1 +cffi==1.17.1 +click==8.1.8 +coverage==7.10.4 +cryptography==45.0.6 +docutils==0.21.2 +exceptiongroup==1.3.0 +hypothesis==6.138.2 +iniconfig==2.1.0 +id==1.5.0 +idna==3.10 +imagesize==1.4.1 +importlib_metadata==8.7.0 +iniconfig==2.1.0 +jaraco.classes==3.4.0 +jaraco.context==6.0.1 +jaraco.functools==4.3.0 +jeepney==0.9.0 +Jinja2==3.1.6 +keyring==25.6.0 +markdown-it-py==3.0.0 +MarkupSafe==3.0.2 +mdurl==0.1.2 +more-itertools==10.7.0 +nh3==0.3.0 +packaging==25.0 +pluggy==1.6.0 +Pygments==2.19.2 +pycparser==2.22 +pydantic==2.11.7 +pydantic-core==2.33.2 +pytest==8.4.1 +readme-renderer==44.0 +requests==2.32.4 +requests-toolbelt==1.0.0 +rfc3986==2.0.0 +rich==14.1.0 +SecretStorage==3.3.3 +setuptools==80.9.0 +setuptools-scm==8.3.0 +snowballstemmer==3.0.1 +sortedcontainers==2.4.0 +Sphinx==8.0.2 +sphinx-rtd-theme==3.0.2 +sphinxcontrib-applehelp==2.0.0 +sphinxcontrib-devhelp==2.0.0 +sphinxcontrib-htmlhelp==2.1.0 +sphinxcontrib-jquery==4.1 +sphinxcontrib-jsmath==1.0.1 +sphinxcontrib-qthelp==2.0.0 +sphinxcontrib-serializinghtml==2.0.0 +tomli==2.2.1 +twine==6.1.0 +typing_extensions==4.14.1 +typing-inspection==0.4.1 +urllib3==2.5.0 +wheel-filename==1.4.2 +zipp==3.23.0 diff --git a/dependencies/default/constraints.txt b/dependencies/default/constraints.txt deleted file mode 100644 index 4db129fb..00000000 --- a/dependencies/default/constraints.txt +++ /dev/null @@ -1,11 +0,0 @@ -attrs==25.3.0 -coverage==7.10.4 -exceptiongroup==1.3.0 -hypothesis==6.138.2 -iniconfig==2.1.0 -packaging==25.0 -pluggy==1.6.0 -pytest==8.4.1 -sortedcontainers==2.4.0 -tomli==2.2.1 -typing_extensions==4.14.1 diff --git a/dependencies/default/requirements.txt b/dependencies/default/requirements.txt deleted file mode 100644 index 42cfc8d3..00000000 --- a/dependencies/default/requirements.txt +++ /dev/null @@ -1,3 +0,0 @@ -# Always adjust install_requires in setup.cfg and pytest-min-requirements.txt -# when changing runtime dependencies -pytest >= 8.2,<9 diff --git a/dependencies/docs/constraints.txt b/dependencies/docs/constraints.txt deleted file mode 100644 index c4524c4b..00000000 --- a/dependencies/docs/constraints.txt +++ /dev/null @@ -1,23 +0,0 @@ -alabaster==0.7.16 -Babel==2.17.0 -certifi==2025.8.3 -charset-normalizer==3.4.3 -docutils==0.21.2 -idna==3.10 -imagesize==1.4.1 -Jinja2==3.1.6 -MarkupSafe==3.0.2 -packaging==25.0 -Pygments==2.19.2 -requests==2.32.4 -snowballstemmer==3.0.1 -Sphinx==8.0.2 -sphinx-rtd-theme==3.0.2 -sphinxcontrib-applehelp==2.0.0 -sphinxcontrib-devhelp==2.0.0 -sphinxcontrib-htmlhelp==2.1.0 -sphinxcontrib-jquery==4.1 -sphinxcontrib-jsmath==1.0.1 -sphinxcontrib-qthelp==2.0.0 -sphinxcontrib-serializinghtml==2.0.0 -urllib3==2.5.0 diff --git a/dependencies/docs/requirements.txt b/dependencies/docs/requirements.txt deleted file mode 100644 index 1bfd7f50..00000000 --- a/dependencies/docs/requirements.txt +++ /dev/null @@ -1,2 +0,0 @@ -sphinx >= 5.3 -sphinx-rtd-theme >= 1.0 diff --git a/pyproject.toml b/pyproject.toml index d3c5b6bf..e3809be1 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,8 +1,8 @@ [build-system] build-backend = "setuptools.build_meta" requires = [ - "setuptools==80.9", - "setuptools-scm==9.2", + "setuptools>=77", + "setuptools-scm[toml]>=6.2", ] [project] diff --git a/tox.ini b/tox.ini index 3608cc56..b6121581 100644 --- a/tox.ini +++ b/tox.ini @@ -1,26 +1,41 @@ [tox] -minversion = 4.9.0 -envlist = py39, py310, py311, py312, py313, py314, pytest-min, docs, pyright +minversion = 4.28.0 +envlist = build, py39, py310, py311, py312, py313, py314, pytest-min, docs, pyright isolated_build = true passenv = CI +[pkgenv] +constraints = constraints.txt + [testenv] +package = external extras = testing -install_command = python -m pip install \ - --requirement dependencies/default/requirements.txt \ - --constraint dependencies/default/constraints.txt \ - {opts} {packages} +constraints = constraints.txt commands = make test allowlist_externals = make +[testenv:.pkg_external] +deps = build +package_glob = {toxinidir}{/}dist{/}*.whl +commands = + python -c 'import shutil; shutil.rmtree("{toxinidir}{/}dist", ignore_errors=True)' + pyproject-build --outdir {toxinidir}{/}dist . + +[testenv:build] +description = Check distribution files +deps = + check-wheel-contents + twine +commands = + check-wheel-contents {toxinidir}{/}dist + twine check {toxinidir}{/}dist{/}* + [testenv:pytest-min] extras = testing -install_command = python -m pip install \ - --requirement dependencies/pytest-min/requirements.txt \ - --constraint dependencies/pytest-min/constraints.txt \ - {opts} {packages} +constraints = dependencies/pytest-min/constraints.txt +deps = -r dependencies/pytest-min/requirements.txt commands = make test allowlist_externals = make @@ -29,9 +44,6 @@ allowlist_externals = allowlist_externals = git extras = docs -deps = - --requirement dependencies/docs/requirements.txt - --constraint dependencies/docs/constraints.txt change_dir = docs description = Build The Docs with {basepython} commands = @@ -78,7 +90,7 @@ skip_install = true [gh-actions] python = - 3.9: py39, pytest-min + 3.9: py39, pytest-min, build 3.10: py310 3.11: py311 3.12: py312