Skip to content

Commit aa62092

Browse files
committed
Add preliminary support for Python 3.13
1 parent 38a89f0 commit aa62092

File tree

5 files changed

+57
-3
lines changed

5 files changed

+57
-3
lines changed

.github/workflows/tests.yml

+42
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,7 @@ 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:
@@ -130,7 +131,17 @@ 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+
echo "cffi @ git+https://github.com/python-cffi/cffi.git@954cab4f889fb019a7f90df153ee1be501495f58" > cffi_constraint.txt
142+
PIP_CONSTRAINT=$PWD/cffi_constraint.txt pip install cffi
133143
- name: Install Build Dependencies
144+
if: matrix.python-version != '3.13.0-alpha - 3.13.0'
134145
run: |
135146
pip install -U pip
136147
pip install -U setuptools wheel twine cffi
@@ -174,7 +185,18 @@ jobs:
174185
python setup.py build_ext -i
175186
python setup.py bdist_wheel
176187
188+
- name: Install AccessControl and dependencies (3.13.0-alpha - 3.13.0)
189+
if: matrix.python-version == '3.13.0-alpha - 3.13.0'
190+
run: |
191+
# Install to collect dependencies into the (pip) cache.
192+
# cffi will probably have no public release until a Python 3.13 beta
193+
# or even RC release, see https://github.com/python-cffi/cffi/issues/23
194+
echo "cffi @ git+https://github.com/python-cffi/cffi.git@954cab4f889fb019a7f90df153ee1be501495f58" > cffi_constraint.txt
195+
# Use "--pre" here because dependencies with support for this future
196+
# Python release may only be available as pre-releases
197+
PIP_CONSTRAINT=$PWD/cffi_constraint.txt pip install --pre .[test]
177198
- name: Install AccessControl and dependencies
199+
if: matrix.python-version != '3.13.0-alpha - 3.13.0'
178200
run: |
179201
# Install to collect dependencies into the (pip) cache.
180202
pip install .[test]
@@ -218,6 +240,7 @@ jobs:
218240
&& startsWith(github.ref, 'refs/tags')
219241
&& startsWith(runner.os, 'Mac')
220242
&& !startsWith(matrix.python-version, 'pypy')
243+
&& !startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0')
221244
env:
222245
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
223246
run: |
@@ -236,6 +259,7 @@ jobs:
236259
- "3.10"
237260
- "3.11"
238261
- "3.12"
262+
- "3.13.0-alpha - 3.13.0"
239263
os: [ubuntu-20.04, macos-11]
240264

241265
steps:
@@ -269,7 +293,25 @@ jobs:
269293
with:
270294
name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}.whl
271295
path: dist/
296+
- name: Install AccessControl 3.13.0-alpha - 3.13.0
297+
if: ${{ startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') }}
298+
run: |
299+
pip install -U wheel setuptools
300+
# cffi will probably have no public release until a beta or even RC
301+
# version of Python 3.13, see https://github.com/python-cffi/cffi/issues/23
302+
echo 'cffi @ git+https://github.com/python-cffi/cffi.git@954cab4f889fb019a7f90df153ee1be501495f58 ; platform_python_implementation == "CPython"' > cffi_constraint.txt
303+
# coverage has a wheel on PyPI for a future python version which is
304+
# not ABI compatible with the current one, so build it from sdist:
305+
pip install -U --no-binary :all: coverage
306+
# Unzip into src/ so that testrunner can find the .so files
307+
# when we ask it to load tests from that directory. This
308+
# might also save some build time?
309+
unzip -n dist/AccessControl-*whl -d src
310+
# Use "--pre" here because dependencies with support for this future
311+
# Python release may only be available as pre-releases
312+
PIP_CONSTRAINT=$PWD/cffi_constraint.txt pip install --pre -U -e .[test]
272313
- name: Install AccessControl
314+
if: ${{ !startsWith(matrix.python-version, '3.13.0-alpha - 3.13.0') }}
273315
run: |
274316
pip install -U wheel setuptools
275317
pip install -U coverage

.manylinux-install.sh

+9-2
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

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ commit-id = "1351c95d"
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

appveyor.yml

+3
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

+2
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

0 commit comments

Comments
 (0)