From 6a07e233dd72adc332c2d0743a290cc8a1e1539c Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 6 Nov 2023 08:37:44 +0100 Subject: [PATCH 1/9] Add preliminary support for Python 3.13a1 --- .github/workflows/tests.yml | 26 ++++++++++++++++++++++++++ .manylinux-install.sh | 11 +++++++++-- .meta.toml | 2 +- CHANGES.rst | 3 +++ appveyor.yml | 3 +++ tox.ini | 34 +++++++++++++++++++++++++++++----- 6 files changed, 71 insertions(+), 8 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index e35deb8..9fbec53 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -103,6 +103,7 @@ jobs: - "3.10" - "3.11" - "3.12" + - "3.13.0-alpha - 3.13.0" os: [ubuntu-20.04, macos-11] exclude: - os: macos-11 @@ -178,7 +179,15 @@ jobs: python setup.py build_ext -i python setup.py bdist_wheel + - name: Install persistent and dependencies (3.13.0-alpha - 3.13.0) + if: matrix.python-version == '3.13.0-alpha - 3.13.0' + 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 persistent and dependencies + if: matrix.python-version != '3.13.0-alpha - 3.13.0' run: | # Install to collect dependencies into the (pip) cache. pip install .[test] @@ -222,6 +231,7 @@ jobs: && startsWith(github.ref, 'refs/tags') && startsWith(runner.os, 'Mac') && !startsWith(matrix.python-version, 'pypy') + && !startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') env: TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }} run: | @@ -241,6 +251,7 @@ jobs: - "3.10" - "3.11" - "3.12" + - "3.13.0-alpha - 3.13.0" os: [ubuntu-20.04, macos-11] exclude: - os: macos-11 @@ -277,7 +288,22 @@ jobs: with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ + - name: Install persistent 3.13.0-alpha - 3.13.0 + if: ${{ startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') }} + run: | + pip install -U wheel setuptools + # coverage has 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/persistent-*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 persistent + if: ${{ !startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') }} run: | pip install -U wheel setuptools pip install -U coverage diff --git a/.manylinux-install.sh b/.manylinux-install.sh index c0e755e..804f2e3 100755 --- a/.manylinux-install.sh +++ b/.manylinux-install.sh @@ -28,6 +28,7 @@ yum -y install libffi-devel tox_env_map() { case $1 in + *"cp313"*) echo 'py313';; *"cp37"*) echo 'py37';; *"cp38"*) echo 'py38';; *"cp39"*) echo 'py39';; @@ -41,14 +42,20 @@ tox_env_map() { # Compile wheels for PYBIN in /opt/python/*/bin; do if \ + [[ "${PYBIN}" == *"cp313"* ]] || \ [[ "${PYBIN}" == *"cp311"* ]] || \ [[ "${PYBIN}" == *"cp312"* ]] || \ [[ "${PYBIN}" == *"cp37"* ]] || \ [[ "${PYBIN}" == *"cp38"* ]] || \ [[ "${PYBIN}" == *"cp39"* ]] || \ [[ "${PYBIN}" == *"cp310"* ]] ; then - "${PYBIN}/pip" install -e /io/ - "${PYBIN}/pip" wheel /io/ -w wheelhouse/ + 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 if [ `uname -m` == 'aarch64' ]; then cd /io/ ${PYBIN}/pip install tox diff --git a/.meta.toml b/.meta.toml index a5d220d..0c10279 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 = "a361e1fd" +commit-id = "6f8d8c51" [python] with-appveyor = true diff --git a/CHANGES.rst b/CHANGES.rst index 2fa38fb..800f692 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,6 +5,9 @@ 5.2 (unreleased) ================ +- Add preliminary support for Python 3.13a1. + + 5.1 (2023-10-05) ================ diff --git a/appveyor.yml b/appveyor.yml index b45ae63..c20525e 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -16,6 +16,9 @@ environment: - python: 310-x64 - python: 311-x64 - python: 312-x64 + # `multibuild` cannot install non-final versions as they are not on + # ftp.python.org, so we skip Python 3.13 until its final release: + # - python: 313-x64 install: - "SET PYTHONVERSION=%PYTHON%" diff --git a/tox.ini b/tox.ini index 9da9501..ec43d1b 100644 --- a/tox.ini +++ b/tox.ini @@ -10,14 +10,17 @@ envlist = py310,py310-pure py311,py311-pure py312,py312-pure + py313,py313-pure pypy3 docs coverage [testenv] usedevelop = true +pip_pre = py313: true deps = py37: urllib3 < 2 + Sphinx setenv = pure: PURE_PYTHON=1 !pure-!pypy3: PURE_PYTHON=0 @@ -46,17 +49,38 @@ commands = python -c 'import os, subprocess; subprocess.check_call("coverage run -a -m zope.testrunner --test-path=src", env=dict(os.environ, PURE_PYTHON="0"), shell=True)' coverage html -i coverage report -i -m --fail-under=99.8 - -[testenv:lint] +[testenv:release-check] +description = ensure that the distribution is ready to release basepython = python3 skip_install = true +deps = + twine + build + check-manifest + check-python-versions >= 0.20.0 + wheel commands = check-manifest check-python-versions + python -m build --sdist --no-isolation + twine check dist/* + +[testenv:lint] +basepython = python3 +skip_install = true deps = - check-manifest - check-python-versions >= 0.19.1 - wheel + isort +commands = + isort --check-only --diff {toxinidir}/src {toxinidir}/setup.py + +[testenv:isort-apply] +basepython = python3 +skip_install = true +commands_pre = +deps = + isort +commands = + isort {toxinidir}/src {toxinidir}/setup.py [] [testenv:docs] basepython = python3 From bc85e1be45ce7a54446af532e748ea2dd6f90185 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 22 Jan 2024 08:40:29 +0100 Subject: [PATCH 2/9] Try to use a non released cffi version. --- .github/workflows/tests.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9fbec53..f7316e0 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -135,7 +135,17 @@ jobs: restore-keys: | ${{ runner.os }}-pip- + - name: Install Build Dependencies (3.13.0-alpha - 3.13.0) + if: matrix.python-version == '3.13.0-alpha - 3.13.0' + run: | + pip install -U pip + pip install -U setuptools wheel twine + # cffi will probably have no public release until a beta or even RC + # version of Python 3.13. + pip install -U cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip + - name: Install Build Dependencies + if: matrix.python-version != '3.13.0-alpha - 3.13.0' run: | pip install -U pip pip install -U setuptools wheel twine cffi From c413d56f39526cbc7725640235c9e0a6581b40b9 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 22 Jan 2024 08:41:56 +0100 Subject: [PATCH 3/9] Fix syntax. --- .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 f7316e0..71b58aa 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -142,7 +142,7 @@ jobs: pip install -U setuptools wheel twine # cffi will probably have no public release until a beta or even RC # version of Python 3.13. - pip install -U cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip + pip install -U "cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip" - name: Install Build Dependencies if: matrix.python-version != '3.13.0-alpha - 3.13.0' From 95accb123a7adcc93252e56c6aeb685b5cd60a6f Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 22 Jan 2024 08:48:36 +0100 Subject: [PATCH 4/9] We also need an unreleased twine. --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 71b58aa..2b3bad3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -141,8 +141,10 @@ jobs: pip install -U pip pip install -U setuptools wheel twine # cffi will probably have no public release until a beta or even RC - # version of Python 3.13. + # version of Python 3.13, see https://github.com/python-cffi/cffi/issues/23 pip install -U "cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip" + # twine has no release for 3.13, yet, see https://github.com/pypa/twine/issues/1030 + pip install -U "twine @ https://github.com/pypa/twine/archive/refs/heads/main.zip" - name: Install Build Dependencies if: matrix.python-version != '3.13.0-alpha - 3.13.0' From 41e2b6d3ae63b7bb43de70ebc7f161332f3e3f0a Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 22 Jan 2024 09:12:12 +0100 Subject: [PATCH 5/9] Try it another way. --- .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 2b3bad3..abbcb37 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -144,7 +144,7 @@ jobs: # version of Python 3.13, see https://github.com/python-cffi/cffi/issues/23 pip install -U "cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip" # twine has no release for 3.13, yet, see https://github.com/pypa/twine/issues/1030 - pip install -U "twine @ https://github.com/pypa/twine/archive/refs/heads/main.zip" + pip install -U "git+https://github.com/pypa/twine.git#egg=twine" - name: Install Build Dependencies if: matrix.python-version != '3.13.0-alpha - 3.13.0' From 70f94d3793fbc8565b9d28f409f8f8d8f8d4ab22 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 22 Jan 2024 10:32:25 +0100 Subject: [PATCH 6/9] Another place we need an unreleased cffi for 3.13. --- .github/workflows/tests.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index abbcb37..237ee76 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -319,7 +319,9 @@ jobs: run: | pip install -U wheel setuptools pip install -U coverage - pip install -U 'cffi; platform_python_implementation == "CPython"' + # cffi will probably have no public release until a beta or even RC + # version of Python 3.13, see https://github.com/python-cffi/cffi/issues/23 + pip install -U 'cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip ; 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? From 9da628a29ab4bab5dabcc518bf9e4df57c77bfe9 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Mon, 22 Jan 2024 10:39:09 +0100 Subject: [PATCH 7/9] Put to the wrong place. --- .github/workflows/tests.yml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 237ee76..493cbc3 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -304,6 +304,9 @@ jobs: if: ${{ startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') }} run: | pip install -U wheel setuptools + # cffi will probably have no public release until a beta or even RC + # version of Python 3.13, see https://github.com/python-cffi/cffi/issues/23 + pip install -U 'cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip ; platform_python_implementation == "CPython"' # coverage has 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 @@ -319,9 +322,7 @@ jobs: run: | pip install -U wheel setuptools pip install -U coverage - # cffi will probably have no public release until a beta or even RC - # version of Python 3.13, see https://github.com/python-cffi/cffi/issues/23 - pip install -U 'cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip ; platform_python_implementation == "CPython"' + 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? From 7dc1add157d5fa80efb74c9c7e8067ef40125932 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Tue, 23 Jan 2024 08:24:20 +0100 Subject: [PATCH 8/9] Configuring for c-code --- .github/workflows/tests.yml | 47 ++++++++++++++++++------------------- .meta.toml | 2 +- tox.ini | 1 + 3 files changed, 25 insertions(+), 25 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 493cbc3..596a5f8 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -96,7 +96,7 @@ jobs: fail-fast: false matrix: python-version: - - "pypy-3.9" + - "pypy-3.10" - "3.7" - "3.8" - "3.9" @@ -107,13 +107,13 @@ jobs: os: [ubuntu-20.04, macos-11] exclude: - os: macos-11 - python-version: "pypy-3.9" + python-version: "pypy-3.10" steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} ### @@ -140,12 +140,11 @@ jobs: run: | pip install -U pip pip install -U setuptools wheel twine - # cffi will probably have no public release until a beta or even RC - # version of Python 3.13, see https://github.com/python-cffi/cffi/issues/23 + # cffi will probably have no public release until a Python 3.13 beta + # or even RC release, see https://github.com/python-cffi/cffi/issues/23 pip install -U "cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip" # twine has no release for 3.13, yet, see https://github.com/pypa/twine/issues/1030 pip install -U "git+https://github.com/pypa/twine.git#egg=twine" - - name: Install Build Dependencies if: matrix.python-version != '3.13.0-alpha - 3.13.0' run: | @@ -211,7 +210,7 @@ jobs: - name: Upload persistent wheel (macOS x86_64) if: > startsWith(runner.os, 'Mac') - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/*x86_64.whl @@ -220,7 +219,7 @@ jobs: startsWith(runner.os, 'Mac') && !(startsWith(matrix.python-version, 'pypy') || matrix.python-version == '3.7') - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: # The arm64 wheel is uploaded with a different name just so it can be # manually downloaded when desired. The wheel itself *cannot* be tested @@ -230,7 +229,7 @@ jobs: - name: Upload persistent wheel (all other platforms) if: > !startsWith(runner.os, 'Mac') - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/*whl @@ -256,7 +255,7 @@ jobs: fail-fast: false matrix: python-version: - - "pypy-3.9" + - "pypy-3.10" - "3.7" - "3.8" - "3.9" @@ -267,13 +266,13 @@ jobs: os: [ubuntu-20.04, macos-11] exclude: - os: macos-11 - python-version: "pypy-3.9" + python-version: "pypy-3.10" steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} ### @@ -296,7 +295,7 @@ jobs: ${{ runner.os }}-pip- - name: Download persistent wheel - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ @@ -366,9 +365,9 @@ jobs: steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} ### @@ -391,7 +390,7 @@ jobs: ${{ runner.os }}-pip- - name: Download persistent wheel - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ @@ -417,9 +416,9 @@ jobs: steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} ### @@ -442,7 +441,7 @@ jobs: ${{ runner.os }}-pip- - name: Download persistent wheel - uses: actions/download-artifact@v3 + uses: actions/download-artifact@v4 with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}.whl path: dist/ @@ -470,9 +469,9 @@ jobs: steps: - name: checkout - uses: actions/checkout@v3 + uses: actions/checkout@v4 - name: Set up Python ${{ matrix.python-version }} - uses: actions/setup-python@v4 + uses: actions/setup-python@v5 with: python-version: ${{ matrix.python-version }} ### @@ -522,7 +521,7 @@ jobs: bash .manylinux.sh - name: Upload persistent wheels - uses: actions/upload-artifact@v3 + uses: actions/upload-artifact@v4 with: path: wheelhouse/*whl name: manylinux_${{ matrix.image }}_wheels.zip diff --git a/.meta.toml b/.meta.toml index 0c10279..81e47b3 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 = "6f8d8c51" +commit-id = "0160ca3b" [python] with-appveyor = true diff --git a/tox.ini b/tox.ini index ec43d1b..2ff11e8 100644 --- a/tox.ini +++ b/tox.ini @@ -59,6 +59,7 @@ deps = check-manifest check-python-versions >= 0.20.0 wheel +commands_pre = commands = check-manifest check-python-versions From 6a88fc17d11cfd67648ee86690a2c4185978cc10 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Tue, 23 Jan 2024 09:11:20 +0100 Subject: [PATCH 9/9] Update CHANGES.rst --- CHANGES.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.rst b/CHANGES.rst index 800f692..9e5cd5c 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -5,7 +5,7 @@ 5.2 (unreleased) ================ -- Add preliminary support for Python 3.13a1. +- Add preliminary support for Python 3.13a3. 5.1 (2023-10-05)