diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index 2737e95..2fea475 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -94,6 +94,7 @@ jobs: - "3.12" - "3.13" - "3.14" + - "3.15" os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm] exclude: - os: macos-latest @@ -149,7 +150,13 @@ jobs: key: ${{ runner.os }}-${{ runner.arch }}-pip-${{ matrix.python-version }} + - name: Install Build Dependencies (3.15) + if: 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: matrix.python-version != '3.15' run: | pip install -U pip pip install -U "setuptools >= 78.1.1,< 82" wheel twine @@ -197,7 +204,15 @@ jobs: run: | python setup.py sdist + - name: Install persistent and dependencies (3.15) + if: 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 persistent and dependencies + if: matrix.python-version != '3.15' run: | # Install to collect dependencies into the (pip) cache. pip install -U pip "setuptools >= 78.1.1,< 82" @@ -261,6 +276,7 @@ jobs: - "3.12" - "3.13" - "3.14" + - "3.15" os: [ubuntu-latest, macos-latest, windows-latest, windows-11-arm] exclude: - os: macos-latest @@ -328,7 +344,23 @@ jobs: with: name: persistent-${{ runner.os }}-${{ matrix.python-version }}-${{ runner.arch }}.whl path: dist/ + - name: Install persistent ${{ matrix.python-version }} + if: 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 persistent + if: matrix.python-version != '3.15' run: | pip install -U wheel "setuptools >= 78.1.1,< 82" pip install -U coverage[toml] @@ -356,7 +388,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 @@ -365,7 +397,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 @@ -590,6 +622,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 94109ba..a2260ca 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 4596477..8abcba3 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 = "51f0db4e" [python] with-windows = true with-pypy = true -with-future-python = false +with-future-python = true with-docs = true with-sphinx-doctests = true with-macos = false diff --git a/CHANGES.rst b/CHANGES.rst index 6010609..66ae27e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -4,7 +4,7 @@ Change log 6.7 (unreleased) ---------------- -- Nothing changed yet. +- Add preliminary support for Python 3.15b1. 6.6 (2026-05-04) diff --git a/pyproject.toml b/pyproject.toml index 2223f60..16a41ac 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -98,6 +98,7 @@ source = [ [tool.setuptools.dynamic] readme = {file = ["README.rst", "CHANGES.rst"]} + [tool.zest-releaser] create-wheel = false upload-pypi = false diff --git a/src/persistent/_compat.h b/src/persistent/_compat.h index 18d0e3b..33db927 100644 --- a/src/persistent/_compat.h +++ b/src/persistent/_compat.h @@ -29,4 +29,10 @@ #define INT_AS_LONG(x) PyLong_AsLong(x) #define CAPI_CAPSULE_NAME "persistent.cPersistence.CAPI" +/* PyPy only provides Py_TRASHCAN_SAFE_BEGIN/Py_TRASHCAN_SAFE_END. */ +#ifndef Py_TRASHCAN_BEGIN +#define Py_TRASHCAN_BEGIN(op, dealloc) Py_TRASHCAN_SAFE_BEGIN(op) +#define Py_TRASHCAN_END Py_TRASHCAN_SAFE_END(NULL) +#endif + #endif diff --git a/tox.ini b/tox.ini index f4878c4..7f8ccb6 100644 --- a/tox.ini +++ b/tox.ini @@ -10,14 +10,17 @@ envlist = py312,py312-pure py313,py313-pure py314,py314-pure + py315,py315-pure py314t,py314t-pure pypy3 docs coverage [testenv] +pip_pre = py315: true deps = setuptools >= 78.1.1,< 82 + Sphinx setenv = pure: PURE_PYTHON=1 !pure-!pypy3: PURE_PYTHON=0