From 9c82b24d853d92678d7afc39f98e84c0d9a95dd1 Mon Sep 17 00:00:00 2001 From: Michael Howitz Date: Wed, 27 May 2026 08:48:29 +0200 Subject: [PATCH] Configuring for c-code --- .github/workflows/tests.yml | 39 +++++++++++++++++++++++++++++++++++-- .manylinux-install.sh | 13 ++++++++++--- .meta.toml | 4 ++-- CHANGES.rst | 2 ++ pyproject.toml | 1 + tox.ini | 2 ++ 6 files changed, 54 insertions(+), 7 deletions(-) diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 9fcd091..23a5921 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -93,6 +93,7 @@ jobs: - "3.12" - "3.13" - "3.14" + - "3.15" os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm] exclude: - os: windows-11-arm @@ -141,7 +142,13 @@ jobs: key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} + - name: Install Build Dependencies (3.15) + if: startsWith(matrix.python-version, '3.15') + run: | + pip install -U pip + pip install -U "setuptools >= 78.1.1,< 82" wheel twine cffi pycparser - name: Install Build Dependencies + if: ${{ !startsWith(matrix.python-version, '3.15') }} run: | pip install -U pip pip install -U "setuptools >= 78.1.1,< 82" wheel twine @@ -189,7 +196,15 @@ jobs: run: | python setup.py sdist + - name: Install AccessControl and dependencies (3.15) + if: startsWith(matrix.python-version, '3.15') + 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 AccessControl and dependencies + if: ${{ !startsWith(matrix.python-version, '3.15') }} run: | # Install to collect dependencies into the (pip) cache. pip install -U pip "setuptools >= 78.1.1,< 82" @@ -252,6 +267,7 @@ jobs: - "3.12" - "3.13" - "3.14" + - "3.15" os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm] exclude: - os: windows-11-arm @@ -312,7 +328,23 @@ jobs: with: name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}-${{ runner.arch }}.whl path: dist/ + - name: Install AccessControl ${{ matrix.python-version }} + if: startsWith(matrix.python-version, '3.15') + run: | + pip install -U wheel "setuptools >= 78.1.1,< 82" + # 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[toml] + # 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? + ls -l dist/ + unzip -n dist/*.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 AccessControl + if: ${{ !startsWith(matrix.python-version, '3.15') }} run: | pip install -U wheel "setuptools >= 78.1.1,< 82" pip install -U coverage[toml] @@ -340,7 +372,7 @@ jobs: - name: Submit to Coveralls # This is a container action, which only runs on Linux. if: ${{ startsWith(runner.os, 'Linux') }} - uses: AndreMiras/coveralls-python-action@develop + uses: coverallsapp/github-action@v2 with: parallel: true @@ -349,7 +381,7 @@ jobs: runs-on: ubuntu-latest steps: - name: Coveralls Finished - uses: AndreMiras/coveralls-python-action@develop + uses: coverallsapp/github-action@v2 with: parallel-finished: true @@ -507,6 +539,9 @@ jobs: - 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.15' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse + publish: name: Publish to PyPI runs-on: ubuntu-latest diff --git a/.manylinux-install.sh b/.manylinux-install.sh index 02fb14c..df1a5e1 100755 --- a/.manylinux-install.sh +++ b/.manylinux-install.sh @@ -33,6 +33,7 @@ tox_env_map() { *"cp312"*) echo 'py312';; *"cp313"*) echo 'py313';; *"cp314"*) echo 'py314';; + *"cp315"*) echo 'py315';; *) echo 'py';; esac } @@ -44,9 +45,15 @@ for PYBIN in /opt/python/*/bin; do [[ "${PYBIN}" == *"cp311/"* ]] || \ [[ "${PYBIN}" == *"cp312/"* ]] || \ [[ "${PYBIN}" == *"cp313/"* ]] || \ - [[ "${PYBIN}" == *"cp314/"* ]] ; then - "${PYBIN}/pip" install -e /io/ - "${PYBIN}/pip" wheel /io/ -w wheelhouse/ + [[ "${PYBIN}" == *"cp314/"* ]] || \ + [[ "${PYBIN}" == *"cp315/"* ]] ; then + if [[ "${PYBIN}" == *"cp315/"* ]] ; 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 86df9e0..311bbc4 100644 --- a/.meta.toml +++ b/.meta.toml @@ -2,12 +2,12 @@ # https://github.com/zopefoundation/meta/tree/master/src/zope/meta/c-code [meta] template = "c-code" -commit-id = "2c0272ea" +commit-id = "fee4a500" [python] with-windows = true with-pypy = false -with-future-python = false +with-future-python = true with-sphinx-doctests = false with-macos = false with-docs = false diff --git a/CHANGES.rst b/CHANGES.rst index a2c02c1..8c03534 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -7,6 +7,8 @@ For changes before version 3.0, see ``HISTORY.rst``. 7.4 (unreleased) ---------------- +- Add preliminary support for Python 3.15 as of 3.15b1. + - Add support for automatically building and publishing Windows/ARM64 wheels. - Add support for automatically building and publishing source distributions. diff --git a/pyproject.toml b/pyproject.toml index e0bb715..70d81ec 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -104,6 +104,7 @@ source = [ [tool.setuptools.dynamic] readme = {file = ["README.rst", "CHANGES.rst"]} + [tool.zest-releaser] create-wheel = false upload-pypi = false diff --git a/tox.ini b/tox.ini index e65ca44..9042f33 100644 --- a/tox.ini +++ b/tox.ini @@ -10,9 +10,11 @@ envlist = py312,py312-pure py313,py313-pure py314,py314-pure + py315,py315-pure coverage [testenv] +pip_pre = py315: true deps = setuptools >= 78.1.1,< 82 setenv =