Skip to content

Commit f5767dc

Browse files
committed
Preliminary support for Python 3.13a3
1 parent 1fc9588 commit f5767dc

File tree

6 files changed

+72
-19
lines changed

6 files changed

+72
-19
lines changed

.github/workflows/tests.yml

Lines changed: 54 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,13 +102,14 @@ jobs:
102102
- "3.10"
103103
- "3.11"
104104
- "3.12"
105+
- "3.13.0-alpha - 3.13.0"
105106
os: [ubuntu-20.04, macos-11]
106107

107108
steps:
108109
- name: checkout
109-
uses: actions/checkout@v3
110+
uses: actions/checkout@v4
110111
- name: Set up Python ${{ matrix.python-version }}
111-
uses: actions/setup-python@v4
112+
uses: actions/setup-python@v5
112113
with:
113114
python-version: ${{ matrix.python-version }}
114115
###
@@ -130,7 +131,18 @@ jobs:
130131
restore-keys: |
131132
${{ runner.os }}-pip-
132133
134+
- name: Install Build Dependencies (3.13.0-alpha - 3.13.0)
135+
if: matrix.python-version == '3.13.0-alpha - 3.13.0'
136+
run: |
137+
pip install -U pip
138+
pip install -U setuptools wheel twine
139+
# cffi will probably have no public release until a Python 3.13 beta
140+
# or even RC release, see https://github.com/python-cffi/cffi/issues/23
141+
pip install -U "cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip"
142+
# twine has no release for 3.13, yet, see https://github.com/pypa/twine/issues/1030
143+
pip install -U "git+https://github.com/pypa/twine.git#egg=twine"
133144
- name: Install Build Dependencies
145+
if: matrix.python-version != '3.13.0-alpha - 3.13.0'
134146
run: |
135147
pip install -U pip
136148
pip install -U setuptools wheel twine cffi
@@ -174,7 +186,15 @@ jobs:
174186
python setup.py build_ext -i
175187
python setup.py bdist_wheel
176188
189+
- name: Install AccessControl and dependencies (3.13.0-alpha - 3.13.0)
190+
if: matrix.python-version == '3.13.0-alpha - 3.13.0'
191+
run: |
192+
# Install to collect dependencies into the (pip) cache.
193+
# Use "--pre" here because dependencies with support for this future
194+
# Python release may only be available as pre-releases
195+
pip install --pre .[test]
177196
- name: Install AccessControl and dependencies
197+
if: matrix.python-version != '3.13.0-alpha - 3.13.0'
178198
run: |
179199
# Install to collect dependencies into the (pip) cache.
180200
pip install .[test]
@@ -186,7 +206,7 @@ jobs:
186206
- name: Upload AccessControl wheel (macOS x86_64)
187207
if: >
188208
startsWith(runner.os, 'Mac')
189-
uses: actions/upload-artifact@v3
209+
uses: actions/upload-artifact@v4
190210
with:
191211
name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}.whl
192212
path: dist/*x86_64.whl
@@ -195,7 +215,7 @@ jobs:
195215
startsWith(runner.os, 'Mac')
196216
&& !(startsWith(matrix.python-version, 'pypy')
197217
|| matrix.python-version == '3.7')
198-
uses: actions/upload-artifact@v3
218+
uses: actions/upload-artifact@v4
199219
with:
200220
# The arm64 wheel is uploaded with a different name just so it can be
201221
# manually downloaded when desired. The wheel itself *cannot* be tested
@@ -205,7 +225,7 @@ jobs:
205225
- name: Upload AccessControl wheel (all other platforms)
206226
if: >
207227
!startsWith(runner.os, 'Mac')
208-
uses: actions/upload-artifact@v3
228+
uses: actions/upload-artifact@v4
209229
with:
210230
name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}.whl
211231
path: dist/*whl
@@ -218,6 +238,7 @@ jobs:
218238
&& startsWith(github.ref, 'refs/tags')
219239
&& startsWith(runner.os, 'Mac')
220240
&& !startsWith(matrix.python-version, 'pypy')
241+
&& !startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0')
221242
env:
222243
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
223244
run: |
@@ -236,13 +257,14 @@ jobs:
236257
- "3.10"
237258
- "3.11"
238259
- "3.12"
260+
- "3.13.0-alpha - 3.13.0"
239261
os: [ubuntu-20.04, macos-11]
240262

241263
steps:
242264
- name: checkout
243-
uses: actions/checkout@v3
265+
uses: actions/checkout@v4
244266
- name: Set up Python ${{ matrix.python-version }}
245-
uses: actions/setup-python@v4
267+
uses: actions/setup-python@v5
246268
with:
247269
python-version: ${{ matrix.python-version }}
248270
###
@@ -265,11 +287,29 @@ jobs:
265287
${{ runner.os }}-pip-
266288
267289
- name: Download AccessControl wheel
268-
uses: actions/download-artifact@v3
290+
uses: actions/download-artifact@v4
269291
with:
270292
name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}.whl
271293
path: dist/
294+
- name: Install AccessControl 3.13.0-alpha - 3.13.0
295+
if: ${{ startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') }}
296+
run: |
297+
pip install -U wheel setuptools
298+
# cffi will probably have no public release until a beta or even RC
299+
# version of Python 3.13, see https://github.com/python-cffi/cffi/issues/23
300+
pip install -U 'cffi @ https://github.com/python-cffi/cffi/archive/refs/heads/main.zip ; platform_python_implementation == "CPython"'
301+
# coverage has a wheel on PyPI for a future python version which is
302+
# not ABI compatible with the current one, so build it from sdist:
303+
pip install -U --no-binary :all: coverage
304+
# Unzip into src/ so that testrunner can find the .so files
305+
# when we ask it to load tests from that directory. This
306+
# might also save some build time?
307+
unzip -n dist/AccessControl-*whl -d src
308+
# Use "--pre" here because dependencies with support for this future
309+
# Python release may only be available as pre-releases
310+
pip install --pre -U -e .[test]
272311
- name: Install AccessControl
312+
if: ${{ !startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') }}
273313
run: |
274314
pip install -U wheel setuptools
275315
pip install -U coverage
@@ -317,9 +357,9 @@ jobs:
317357

318358
steps:
319359
- name: checkout
320-
uses: actions/checkout@v3
360+
uses: actions/checkout@v4
321361
- name: Set up Python ${{ matrix.python-version }}
322-
uses: actions/setup-python@v4
362+
uses: actions/setup-python@v5
323363
with:
324364
python-version: ${{ matrix.python-version }}
325365
###
@@ -342,7 +382,7 @@ jobs:
342382
${{ runner.os }}-pip-
343383
344384
- name: Download AccessControl wheel
345-
uses: actions/download-artifact@v3
385+
uses: actions/download-artifact@v4
346386
with:
347387
name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}.whl
348388
path: dist/
@@ -370,9 +410,9 @@ jobs:
370410

371411
steps:
372412
- name: checkout
373-
uses: actions/checkout@v3
413+
uses: actions/checkout@v4
374414
- name: Set up Python ${{ matrix.python-version }}
375-
uses: actions/setup-python@v4
415+
uses: actions/setup-python@v5
376416
with:
377417
python-version: ${{ matrix.python-version }}
378418
###
@@ -422,7 +462,7 @@ jobs:
422462
bash .manylinux.sh
423463
424464
- name: Upload AccessControl wheels
425-
uses: actions/upload-artifact@v3
465+
uses: actions/upload-artifact@v4
426466
with:
427467
path: wheelhouse/*whl
428468
name: manylinux_${{ matrix.image }}_wheels.zip

.manylinux-install.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ yum -y install libffi-devel
2828

2929
tox_env_map() {
3030
case $1 in
31+
*"cp313"*) echo 'py313';;
3132
*"cp37"*) echo 'py37';;
3233
*"cp38"*) echo 'py38';;
3334
*"cp39"*) echo 'py39';;
@@ -41,14 +42,20 @@ tox_env_map() {
4142
# Compile wheels
4243
for PYBIN in /opt/python/*/bin; do
4344
if \
45+
[[ "${PYBIN}" == *"cp313"* ]] || \
4446
[[ "${PYBIN}" == *"cp311"* ]] || \
4547
[[ "${PYBIN}" == *"cp312"* ]] || \
4648
[[ "${PYBIN}" == *"cp37"* ]] || \
4749
[[ "${PYBIN}" == *"cp38"* ]] || \
4850
[[ "${PYBIN}" == *"cp39"* ]] || \
4951
[[ "${PYBIN}" == *"cp310"* ]] ; then
50-
"${PYBIN}/pip" install -e /io/
51-
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
52+
if [[ "${PYBIN}" == *"cp313"* ]] ; 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 = "cb0568c7"
5+
commit-id = "e45966cd"
66

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

CHANGES.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ For changes before version 3.0, see ``HISTORY.rst``.
66
6.4 (unreleased)
77
----------------
88

9-
- Nothing changed yet.
9+
- Add preliminary support for Python 3.13 as of 3.13a3.
1010

1111

1212
6.3 (2023-11-20)

appveyor.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,9 @@ environment:
1616
- python: 310-x64
1717
- python: 311-x64
1818
- python: 312-x64
19+
# `multibuild` cannot install non-final versions as they are not on
20+
# ftp.python.org, so we skip Python 3.13 until its final release:
21+
# - python: 313-x64
1922

2023
install:
2124
- "SET PYTHONVERSION=%PYTHON%"

tox.ini

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,12 @@ envlist =
1010
py310,py310-pure
1111
py311,py311-pure
1212
py312,py312-pure
13+
py313,py313-pure
1314
coverage
1415

1516
[testenv]
1617
usedevelop = true
18+
pip_pre = py313: true
1719
deps =
1820
setenv =
1921
pure: PURE_PYTHON=1
@@ -48,6 +50,7 @@ deps =
4850
check-manifest
4951
check-python-versions >= 0.20.0
5052
wheel
53+
commands_pre =
5154
commands =
5255
check-manifest
5356
check-python-versions

0 commit comments

Comments
 (0)