From 0f0c36627ed940a582aa5e1ea5a78f4c782268a0 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Sun, 15 Sep 2024 13:27:20 +0200 Subject: [PATCH 1/6] - add final support for Python 3.13 --- .coveragerc | 30 ---------------------------- .github/workflows/tests.yml | 39 ++----------------------------------- .manylinux-install.sh | 13 ++++--------- .meta.toml | 4 ++-- CHANGES.rst | 2 +- MANIFEST.in | 1 - tox.ini | 15 +++++++++----- 7 files changed, 19 insertions(+), 85 deletions(-) delete mode 100644 .coveragerc diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 819f88f..0000000 --- a/.coveragerc +++ /dev/null @@ -1,30 +0,0 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/c-code -[run] -source = ExtensionClass -# New in 5.0; required for the GHA coveralls submission. -relative_files = True -branch = true - -[paths] -source = - src/ - .tox/*/lib/python*/site-packages/ - .tox/pypy*/site-packages/ - -[report] -show_missing = true -precision = 2 -ignore_errors = True -exclude_lines = - except ImportError: - if __name__ == '__main__': - pragma: no cover - pragma: nocover - raise AssertionError - raise NotImplementedError - raise unittest.Skip - self.fail\( - -[html] -directory = parts/htmlcov diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e827ee4..5b41de5 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -115,7 +115,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - allow-prereleases: true ### # Caching. # This actually *restores* a cache and schedules a cleanup action @@ -152,16 +151,10 @@ jobs: restore-keys: | ${{ runner.os }}-pip- - - name: Install Build Dependencies (3.13) - if: matrix.python-version == '3.13' - run: | - pip install -U pip - pip install -U "setuptools<74" wheel twine - name: Install Build Dependencies - if: matrix.python-version != '3.13' run: | pip install -U pip - pip install -U "setuptools<74" wheel twine + pip install -U "setuptools <74" wheel twine - name: Build ExtensionClass (macOS x86_64) if: > @@ -199,15 +192,7 @@ jobs: python setup.py build_ext -i python setup.py bdist_wheel - - name: Install ExtensionClass and dependencies (3.13) - if: matrix.python-version == '3.13' - run: | - # Install to collect dependencies into the (pip) cache. - # Use "--pre" here because dependencies with support for this future - # Python release may only be available as pre-releases - pip install --pre .[test] - name: Install ExtensionClass and dependencies - if: matrix.python-version != '3.13' run: | # Install to collect dependencies into the (pip) cache. pip install .[test] @@ -250,7 +235,6 @@ jobs: && startsWith(github.ref, 'refs/tags') && !startsWith(runner.os, 'Linux') && !startsWith(matrix.python-version, 'pypy') - && !startsWith(matrix.python-version, '3.13') env: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} run: | @@ -282,7 +266,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - allow-prereleases: true ### # Caching. # This actually *restores* a cache and schedules a cleanup action @@ -324,24 +307,9 @@ jobs: with: name: ExtensionClass-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ - - name: Install ExtensionClass ${{ matrix.python-version }} - if: matrix.python-version == '3.13' - run: | - pip install -U wheel "setuptools<74" - # coverage might have a wheel on PyPI for a future python version which is - # not ABI compatible with the current one, so build it from sdist: - pip install -U --no-binary :all: coverage - # Unzip into src/ so that testrunner can find the .so files - # when we ask it to load tests from that directory. This - # might also save some build time? - unzip -n dist/ExtensionClass-*whl -d src - # Use "--pre" here because dependencies with support for this future - # Python release may only be available as pre-releases - pip install --pre -e .[test] - name: Install ExtensionClass - if: matrix.python-version != '3.13' run: | - pip install -U wheel "setuptools<74" + pip install -U wheel "setuptools <74" pip install -U coverage pip install -U 'cffi; platform_python_implementation == "CPython"' # Unzip into src/ so that testrunner can find the .so files @@ -395,7 +363,6 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} - allow-prereleases: true ### # Caching. # This actually *restores* a cache and schedules a cleanup action @@ -466,8 +433,6 @@ jobs: name: manylinux_${{ matrix.image }}_wheels.zip - name: Restore pip cache permissions run: sudo chown -R $(whoami) ${{ steps.pip-cache-default.outputs.dir }} - - name: Prevent publishing wheels for unreleased Python versions - run: VER=$(echo '3.13' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse - name: Publish package to PyPI uses: pypa/gh-action-pypi-publish@release/v1 if: > diff --git a/.manylinux-install.sh b/.manylinux-install.sh index 8866512..e2ffba4 100755 --- a/.manylinux-install.sh +++ b/.manylinux-install.sh @@ -28,12 +28,12 @@ yum -y install libffi-devel tox_env_map() { case $1 in - *"cp313"*) echo 'py313';; *"cp38"*) echo 'py38';; *"cp39"*) echo 'py39';; *"cp310"*) echo 'py310';; *"cp311"*) echo 'py311';; *"cp312"*) echo 'py312';; + *"cp313"*) echo 'py313';; *) echo 'py';; esac } @@ -41,19 +41,14 @@ tox_env_map() { # Compile wheels for PYBIN in /opt/python/*/bin; do if \ - [[ "${PYBIN}" == *"cp313/"* ]] || \ [[ "${PYBIN}" == *"cp311/"* ]] || \ [[ "${PYBIN}" == *"cp312/"* ]] || \ + [[ "${PYBIN}" == *"cp313/"* ]] || \ [[ "${PYBIN}" == *"cp38/"* ]] || \ [[ "${PYBIN}" == *"cp39/"* ]] || \ [[ "${PYBIN}" == *"cp310/"* ]] ; then - if [[ "${PYBIN}" == *"cp313/"* ]] ; then - "${PYBIN}/pip" install --pre -e /io/ - "${PYBIN}/pip" wheel /io/ --pre -w wheelhouse/ - else - "${PYBIN}/pip" install -e /io/ - "${PYBIN}/pip" wheel /io/ -w wheelhouse/ - fi + "${PYBIN}/pip" install -e /io/ + "${PYBIN}/pip" wheel /io/ -w wheelhouse/ if [ `uname -m` == 'aarch64' ]; then cd /io/ ${PYBIN}/pip install tox diff --git a/.meta.toml b/.meta.toml index d99277a..8ffeb02 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,13 +2,13 @@ # https://github.com/zopefoundation/meta/tree/master/config/c-code [meta] template = "c-code" -commit-id = "a1e05e74" +commit-id = "7c128919" [python] with-windows = true with-pypy = true with-sphinx-doctests = false -with-future-python = true +with-future-python = false with-macos = false with-docs = false diff --git a/CHANGES.rst b/CHANGES.rst index 87da087..5b8db3a 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,7 +7,7 @@ - Build Windows wheels on GHA. -- Add preliminary support for Python 3.13 as of 3.13b1. +- Add support for Python 3.13. - Drop support for Python 3.7. diff --git a/MANIFEST.in b/MANIFEST.in index 72b2cf0..b4ca4f0 100644 --- a/MANIFEST.in +++ b/MANIFEST.in @@ -6,7 +6,6 @@ include *.txt include buildout.cfg include tox.ini include .pre-commit-config.yaml -include .coveragerc recursive-include src *.py include *.sh diff --git a/tox.ini b/tox.ini index 667e8cf..8223b3c 100644 --- a/tox.ini +++ b/tox.ini @@ -14,9 +14,8 @@ envlist = coverage [testenv] -pip_pre = py313: true deps = - setuptools < 74 + setuptools <74 setenv = pure: PURE_PYTHON=1 !pure-!pypy3: PURE_PYTHON=0 @@ -27,25 +26,31 @@ commands = extras = test +[testenv:setuptools-latest] +basepython = python3 +deps = + git+https://github.com/pypa/setuptools.git\#egg=setuptools + [testenv:coverage] basepython = python3 allowlist_externals = mkdir deps = - coverage + coverage[toml] setenv = PURE_PYTHON=1 commands = mkdir -p {toxinidir}/parts/htmlcov coverage run -m zope.testrunner --test-path=src {posargs:-vc} - coverage html -i - coverage report -i -m --fail-under=100 + coverage html + coverage report [testenv:release-check] description = ensure that the distribution is ready to release basepython = python3 skip_install = true deps = + setuptools <74 twine build check-manifest From 8faea5df6df667603d34aa0418d4dd39c1fd8c21 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Sun, 15 Sep 2024 13:28:33 +0200 Subject: [PATCH 2/6] - add missing file --- pyproject.toml | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 pyproject.toml diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..e52b31a --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,26 @@ +# +# Generated from: +# https://github.com/zopefoundation/meta/tree/master/config/c-code + +[build-system] +requires = ["setuptools<74"] +build-backend = "setuptools.build_meta" + +[tool.coverage] +[tool.coverage.run] +branch = true +source = ["ExtensionClass"] +relative_files = true + +[tool.coverage.report] +fail_under = 100 +precision = 2 +ignore_errors = true +show_missing = true +exclude_lines = ["pragma: no cover", "pragma: nocover", "except ImportError:", "raise NotImplementedError", "if __name__ == '__main__':", "self.fail", "raise AssertionError", "raise unittest.Skip"] + +[tool.coverage.html] +directory = "parts/htmlcov" + +[tool.coverage.paths] +source = ["src/", ".tox/*/lib/python*/site-packages/", ".tox/pypy*/site-packages/"] From 1ca5881a923c5ba5af9124629bc2382caf138fb3 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Sun, 15 Sep 2024 13:39:11 +0200 Subject: [PATCH 3/6] - set allow-prereleases --- .github/workflows/tests.yml | 3 +++ .meta.toml | 2 +- 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 5b41de5..8a1d487 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -115,6 +115,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true ### # Caching. # This actually *restores* a cache and schedules a cleanup action @@ -266,6 +267,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true ### # Caching. # This actually *restores* a cache and schedules a cleanup action @@ -363,6 +365,7 @@ jobs: uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} + allow-prereleases: true ### # Caching. # This actually *restores* a cache and schedules a cleanup action diff --git a/.meta.toml b/.meta.toml index 8ffeb02..e50fcc8 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,7 +2,7 @@ # https://github.com/zopefoundation/meta/tree/master/config/c-code [meta] template = "c-code" -commit-id = "7c128919" +commit-id = "2c0dbda3" [python] with-windows = true From a4dbbfce5b771349be7606800a1c64dcf5e636fa Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Sun, 15 Sep 2024 13:48:41 +0200 Subject: [PATCH 4/6] - install coverage toml extra --- .github/workflows/tests.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 8a1d487..f05afef 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -312,7 +312,7 @@ jobs: - name: Install ExtensionClass run: | pip install -U wheel "setuptools <74" - pip install -U coverage + pip install -U coverage[toml] pip install -U 'cffi; platform_python_implementation == "CPython"' # Unzip into src/ so that testrunner can find the .so files # when we ask it to load tests from that directory. This From 282d4c1937094736cda5c7f29a2fe590399e9b39 Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Sun, 15 Sep 2024 14:09:04 +0200 Subject: [PATCH 5/6] -dial down fail-under because on pypy we never reach 100% --- .meta.toml | 2 +- pyproject.toml | 2 +- tox.ini | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.meta.toml b/.meta.toml index e50fcc8..db214bd 100644 --- a/.meta.toml +++ b/.meta.toml @@ -16,7 +16,7 @@ with-docs = false use-flake8 = true [coverage] -fail-under = 100 +fail-under = 99.5 [manifest] additional-rules = [ diff --git a/pyproject.toml b/pyproject.toml index e52b31a..f50fc26 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -13,7 +13,7 @@ source = ["ExtensionClass"] relative_files = true [tool.coverage.report] -fail_under = 100 +fail_under = 99.5 precision = 2 ignore_errors = true show_missing = true diff --git a/tox.ini b/tox.ini index 8223b3c..4c2b3ee 100644 --- a/tox.ini +++ b/tox.ini @@ -19,8 +19,6 @@ deps = setenv = pure: PURE_PYTHON=1 !pure-!pypy3: PURE_PYTHON=0 - py312: VIRTUALENV_PIP=23.1.2 - py312: PIP_REQUIRE_VIRTUALENV=0 commands = zope-testrunner --test-path=src {posargs:-vc} extras = From a3bc39013fc09e186d6005384157a4fcc1a26d3d Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Sun, 15 Sep 2024 14:16:26 +0200 Subject: [PATCH 6/6] - add Python 3.13 specifier --- setup.py | 1 + 1 file changed, 1 insertion(+) diff --git a/setup.py b/setup.py index 29c2c3e..9674957 100644 --- a/setup.py +++ b/setup.py @@ -75,6 +75,7 @@ "Programming Language :: Python :: 3.10", "Programming Language :: Python :: 3.11", "Programming Language :: Python :: 3.12", + "Programming Language :: Python :: 3.13", "Programming Language :: Python :: Implementation :: CPython", "Programming Language :: Python :: Implementation :: PyPy", ],