From fb70d40fa24608a12b7048cf6fd40a395089b39f Mon Sep 17 00:00:00 2001 From: Jens Vagelpohl Date: Mon, 16 Sep 2024 09:56:42 +0200 Subject: [PATCH] - update to latest meta/config, declare final Python 3.13 support --- .coveragerc | 30 ------------------------- .github/workflows/tests.yml | 44 +++++-------------------------------- .manylinux-install.sh | 13 ++++------- .meta.toml | 4 ++-- CHANGES.rst | 2 ++ MANIFEST.in | 1 - pyproject.toml | 26 ++++++++++++++++++++++ setup.py | 1 + tox.ini | 17 ++++++++------ 9 files changed, 50 insertions(+), 88 deletions(-) delete mode 100644 .coveragerc create mode 100644 pyproject.toml diff --git a/.coveragerc b/.coveragerc deleted file mode 100644 index 3701575..0000000 --- a/.coveragerc +++ /dev/null @@ -1,30 +0,0 @@ -# Generated from: -# https://github.com/zopefoundation/meta/tree/master/config/c-code -[run] -source = zope.container -# 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 886d4ce..7fbcae2 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -152,17 +152,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 --pre cffi - pip install -U "setuptools<69" wheel twine - name: Install Build Dependencies - if: matrix.python-version != '3.13' run: | pip install -U pip - pip install -U "setuptools<69" wheel twine + pip install -U "setuptools <74" wheel twine pip install cffi pip install -U zope.proxy pip install -U persistent @@ -203,15 +196,7 @@ jobs: python setup.py build_ext -i python setup.py bdist_wheel - - name: Install zope.container 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 zope.container and dependencies - if: matrix.python-version != '3.13' run: | # Install to collect dependencies into the (pip) cache. pip install .[test] @@ -254,7 +239,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: | @@ -328,32 +312,16 @@ jobs: with: name: zope.container-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ - - name: Install zope.container ${{ matrix.python-version }} - if: matrix.python-version == '3.13' - run: | - pip install -U --pre cffi - pip install -U wheel "setuptools<69" - # 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/zope.container-*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 -U -e .[test] - name: Install zope.container - if: matrix.python-version != '3.13' run: | - pip install -U wheel "setuptools<69" - pip install -U coverage + pip install -U wheel "setuptools <74" + 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 # might also save some build time? unzip -n dist/zope.container-*whl -d src - pip install -U -e .[test] + pip install -e .[test] - name: Run tests with C extensions if: ${{ !startsWith(matrix.python-version, 'pypy') }} run: | @@ -444,7 +412,7 @@ jobs: - name: Install zope.container run: | pip install -U wheel - pip install -U coverage + pip install -U coverage[toml] pip install -U "`ls dist/zope.container-*.whl`[docs]" - name: Build docs env: @@ -539,8 +507,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 afe8f8b..b904d0f 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 0fbfa63..bcdcbff 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,12 +2,12 @@ # https://github.com/zopefoundation/meta/tree/master/config/c-code [meta] template = "c-code" -commit-id = "9e2b2911" +commit-id = "a7193216" [python] with-windows = true with-pypy = true -with-future-python = true +with-future-python = false with-docs = true with-sphinx-doctests = false with-macos = false diff --git a/CHANGES.rst b/CHANGES.rst index d0d6e6d..e90177c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,8 @@ 6.1 (unreleased) ================ +- Add final support for Python 3.13. + - Update to ``persistent`` 6.0 API usage diff --git a/MANIFEST.in b/MANIFEST.in index f97e95f..0266aa0 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 docs *.py recursive-include docs *.rst diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 0000000..944110c --- /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 = ["zope.container"] +relative_files = true + +[tool.coverage.report] +fail_under = 97 +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/"] diff --git a/setup.py b/setup.py index abae60b..2a1e262 100644 --- a/setup.py +++ b/setup.py @@ -87,6 +87,7 @@ def read(*rnames): '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', 'Natural Language :: English', diff --git a/tox.ini b/tox.ini index a1e8aa3..8f998f4 100644 --- a/tox.ini +++ b/tox.ini @@ -15,39 +15,42 @@ envlist = coverage [testenv] -pip_pre = py313: true deps = - setuptools < 69 + setuptools <74 setenv = pure: PURE_PYTHON=1 !pure-!pypy3: PURE_PYTHON=0 ZOPE_INTERFACE_STRICT_IRO=1 - py312: VIRTUALENV_PIP=23.1.2 - py312: PIP_REQUIRE_VIRTUALENV=0 commands = zope-testrunner --test-path=src {posargs:-vc} 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=97 + 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