Skip to content

Commit 781ea47

Browse files
authored
Add preliminary support for Python 3.14a2. (#81)
1 parent c71bb1d commit 781ea47

File tree

6 files changed

+54
-10
lines changed

6 files changed

+54
-10
lines changed

.github/workflows/tests.yml

Lines changed: 36 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,7 @@ jobs:
103103
- "3.11"
104104
- "3.12"
105105
- "3.13"
106+
- "3.14"
106107
os: [ubuntu-latest, macos-latest, windows-latest]
107108
exclude:
108109
- os: macos-latest
@@ -152,10 +153,16 @@ jobs:
152153
restore-keys: |
153154
${{ runner.os }}-pip-
154155
156+
- name: Install Build Dependencies (3.14)
157+
if: matrix.python-version == '3.14'
158+
run: |
159+
pip install -U pip
160+
pip install -U "setuptools < 74" wheel twine
155161
- name: Install Build Dependencies
162+
if: matrix.python-version != '3.14'
156163
run: |
157164
pip install -U pip
158-
pip install -U "setuptools <74" wheel twine
165+
pip install -U "setuptools < 74" wheel twine
159166
160167
- name: Build ExtensionClass (macOS x86_64)
161168
if: >
@@ -193,7 +200,15 @@ jobs:
193200
python setup.py build_ext -i
194201
python setup.py bdist_wheel
195202
203+
- name: Install ExtensionClass and dependencies (3.14)
204+
if: matrix.python-version == '3.14'
205+
run: |
206+
# Install to collect dependencies into the (pip) cache.
207+
# Use "--pre" here because dependencies with support for this future
208+
# Python release may only be available as pre-releases
209+
pip install --pre .[test]
196210
- name: Install ExtensionClass and dependencies
211+
if: matrix.python-version != '3.14'
197212
run: |
198213
# Install to collect dependencies into the (pip) cache.
199214
pip install .[test]
@@ -236,6 +251,7 @@ jobs:
236251
&& startsWith(github.ref, 'refs/tags')
237252
&& !startsWith(runner.os, 'Linux')
238253
&& !startsWith(matrix.python-version, 'pypy')
254+
&& !startsWith(matrix.python-version, '3.14')
239255
env:
240256
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
241257
run: |
@@ -255,6 +271,7 @@ jobs:
255271
- "3.11"
256272
- "3.12"
257273
- "3.13"
274+
- "3.14"
258275
os: [ubuntu-latest, macos-latest, windows-latest]
259276
exclude:
260277
- os: macos-latest
@@ -309,9 +326,24 @@ jobs:
309326
with:
310327
name: ExtensionClass-${{ runner.os }}-${{ matrix.python-version }}.whl
311328
path: dist/
329+
- name: Install ExtensionClass ${{ matrix.python-version }}
330+
if: matrix.python-version == '3.14'
331+
run: |
332+
pip install -U wheel "setuptools < 74"
333+
# coverage might have a wheel on PyPI for a future python version which is
334+
# not ABI compatible with the current one, so build it from sdist:
335+
pip install -U --no-binary :all: coverage[toml]
336+
# Unzip into src/ so that testrunner can find the .so files
337+
# when we ask it to load tests from that directory. This
338+
# might also save some build time?
339+
unzip -n dist/ExtensionClass-*whl -d src
340+
# Use "--pre" here because dependencies with support for this future
341+
# Python release may only be available as pre-releases
342+
pip install --pre -e .[test]
312343
- name: Install ExtensionClass
344+
if: matrix.python-version != '3.14'
313345
run: |
314-
pip install -U wheel "setuptools <74"
346+
pip install -U wheel "setuptools < 74"
315347
pip install -U coverage[toml]
316348
pip install -U 'cffi; platform_python_implementation == "CPython"'
317349
# Unzip into src/ so that testrunner can find the .so files
@@ -436,6 +468,8 @@ jobs:
436468
name: manylinux_${{ matrix.image }}_wheels.zip
437469
- name: Restore pip cache permissions
438470
run: sudo chown -R $(whoami) ${{ steps.pip-cache-default.outputs.dir }}
471+
- name: Prevent publishing wheels for unreleased Python versions
472+
run: VER=$(echo '3.14' | tr -d .) && ls -al wheelhouse && sudo rm -f wheelhouse/*-cp${VER}*.whl && ls -al wheelhouse
439473
- name: Publish package to PyPI
440474
uses: pypa/gh-action-pypi-publish@release/v1
441475
if: >

.manylinux-install.sh

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ tox_env_map() {
3434
*"cp311"*) echo 'py311';;
3535
*"cp312"*) echo 'py312';;
3636
*"cp313"*) echo 'py313';;
37+
*"cp314"*) echo 'py314';;
3738
*) echo 'py';;
3839
esac
3940
}
@@ -46,9 +47,15 @@ for PYBIN in /opt/python/*/bin; do
4647
[[ "${PYBIN}" == *"cp310/"* ]] || \
4748
[[ "${PYBIN}" == *"cp311/"* ]] || \
4849
[[ "${PYBIN}" == *"cp312/"* ]] || \
49-
[[ "${PYBIN}" == *"cp313/"* ]] ; then
50-
"${PYBIN}/pip" install -e /io/
51-
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
50+
[[ "${PYBIN}" == *"cp313/"* ]] || \
51+
[[ "${PYBIN}" == *"cp314/"* ]] ; then
52+
if [[ "${PYBIN}" == *"cp314/"* ]] ; then
53+
"${PYBIN}/pip" install --pre -e /io/
54+
"${PYBIN}/pip" wheel /io/ --pre -w wheelhouse/
55+
else
56+
"${PYBIN}/pip" install -e /io/
57+
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
58+
fi
5259
if [ `uname -m` == 'aarch64' ]; then
5360
cd /io/
5461
${PYBIN}/pip install tox

.meta.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,13 @@
22
# https://github.com/zopefoundation/meta/tree/master/config/c-code
33
[meta]
44
template = "c-code"
5-
commit-id = "d8a8b5ed"
5+
commit-id = "baf6089f"
66

77
[python]
88
with-windows = true
99
with-pypy = true
1010
with-sphinx-doctests = false
11-
with-future-python = false
11+
with-future-python = true
1212
with-macos = false
1313
with-docs = false
1414

CHANGES.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
6.1 (unreleased)
66
================
77

8+
- Add preliminary support for Python 3.14a2.
89

910
6.0 (2024-09-17)
1011
================

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
# https://github.com/zopefoundation/meta/tree/master/config/c-code
44

55
[build-system]
6-
requires = ["setuptools<74"]
6+
requires = ["setuptools < 74"]
77
build-backend = "setuptools.build_meta"
88

99
[tool.coverage.run]

tox.ini

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,12 +10,14 @@ envlist =
1010
py311,py311-pure
1111
py312,py312-pure
1212
py313,py313-pure
13+
py314,py314-pure
1314
pypy3
1415
coverage
1516

1617
[testenv]
18+
pip_pre = py314: true
1719
deps =
18-
setuptools <74
20+
setuptools < 74
1921
setenv =
2022
pure: PURE_PYTHON=1
2123
!pure-!pypy3: PURE_PYTHON=0
@@ -48,7 +50,7 @@ description = ensure that the distribution is ready to release
4850
basepython = python3
4951
skip_install = true
5052
deps =
51-
setuptools <74
53+
setuptools < 74
5254
twine
5355
build
5456
check-manifest

0 commit comments

Comments
 (0)