Skip to content

Commit ca1826b

Browse files
authored
- drop support for Python 3.7 and add support for Python 3.13 (#154)
1 parent 55121a3 commit ca1826b

File tree

6 files changed

+76
-45
lines changed

6 files changed

+76
-45
lines changed

.github/workflows/tests.yml

Lines changed: 51 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -96,19 +96,13 @@ jobs:
9696
fail-fast: false
9797
matrix:
9898
python-version:
99-
- "3.7"
10099
- "3.8"
101100
- "3.9"
102101
- "3.10"
103102
- "3.11"
104103
- "3.12"
104+
- "3.13"
105105
os: [ubuntu-latest, macos-latest, windows-latest]
106-
exclude:
107-
- os: macos-latest
108-
python-version: "3.7"
109-
include:
110-
- python-version: "3.7"
111-
os: macos-12
112106

113107
steps:
114108
- name: checkout
@@ -117,6 +111,7 @@ jobs:
117111
uses: actions/setup-python@v5
118112
with:
119113
python-version: ${{ matrix.python-version }}
114+
allow-prereleases: true
120115
###
121116
# Caching.
122117
# This actually *restores* a cache and schedules a cleanup action
@@ -153,16 +148,23 @@ jobs:
153148
restore-keys: |
154149
${{ runner.os }}-pip-
155150
151+
- name: Install Build Dependencies (3.13)
152+
if: matrix.python-version == '3.13'
153+
run: |
154+
pip install -U pip
155+
pip install -U "setuptools<69" wheel twine
156+
pip install --pre cffi
156157
- name: Install Build Dependencies
158+
if: matrix.python-version != '3.13'
157159
run: |
158160
pip install -U pip
159161
pip install -U "setuptools<69" wheel twine
162+
pip install cffi
160163
161-
- name: Build AccessControl (macOS x86_64, Python 3.8+)
164+
- name: Build AccessControl (macOS x86_64)
162165
if: >
163166
startsWith(runner.os, 'Mac')
164-
&& !(startsWith(matrix.python-version, 'pypy')
165-
|| matrix.python-version == '3.7')
167+
&& !startsWith(matrix.python-version, 'pypy')
166168
env:
167169
MACOSX_DEPLOYMENT_TARGET: 10.9
168170
_PYTHON_HOST_PLATFORM: macosx-10.9-x86_64
@@ -172,11 +174,10 @@ jobs:
172174
# output (pip install uses a random temporary directory, making this difficult).
173175
python setup.py build_ext -i
174176
python setup.py bdist_wheel
175-
- name: Build AccessControl (macOS arm64, Python 3.8+)
177+
- name: Build AccessControl (macOS arm64)
176178
if: >
177179
startsWith(runner.os, 'Mac')
178-
&& !(startsWith(matrix.python-version, 'pypy')
179-
|| matrix.python-version == '3.7')
180+
&& !startsWith(matrix.python-version, 'pypy')
180181
env:
181182
MACOSX_DEPLOYMENT_TARGET: 11.0
182183
_PYTHON_HOST_PLATFORM: macosx-11.0-arm64
@@ -190,14 +191,21 @@ jobs:
190191
if: >
191192
!startsWith(runner.os, 'Mac')
192193
|| startsWith(matrix.python-version, 'pypy')
193-
|| matrix.python-version == '3.7'
194194
run: |
195195
# Next, build the wheel *in place*. This helps ccache, and also lets us cache the configure
196196
# output (pip install uses a random temporary directory, making this difficult).
197197
python setup.py build_ext -i
198198
python setup.py bdist_wheel
199199
200+
- name: Install AccessControl and dependencies (3.13)
201+
if: matrix.python-version == '3.13'
202+
run: |
203+
# Install to collect dependencies into the (pip) cache.
204+
# Use "--pre" here because dependencies with support for this future
205+
# Python release may only be available as pre-releases
206+
pip install --pre .[test]
200207
- name: Install AccessControl and dependencies
208+
if: matrix.python-version != '3.13'
201209
run: |
202210
# Install to collect dependencies into the (pip) cache.
203211
pip install .[test]
@@ -211,19 +219,18 @@ jobs:
211219
startsWith(runner.os, 'Mac')
212220
uses: actions/upload-artifact@v4
213221
with:
214-
name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}.whl
222+
# The x86_64 wheel is uploaded with a different name just so it can be
223+
# manually downloaded when desired. The wheel itself *cannot* be tested
224+
# on the GHA runner, which uses arm64 architecture.
225+
name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}-x86_64.whl
215226
path: dist/*x86_64.whl
216227
- name: Upload AccessControl wheel (macOS arm64)
217228
if: >
218229
startsWith(runner.os, 'Mac')
219-
&& !(startsWith(matrix.python-version, 'pypy')
220-
|| matrix.python-version == '3.7')
230+
&& !startsWith(matrix.python-version, 'pypy')
221231
uses: actions/upload-artifact@v4
222232
with:
223-
# The arm64 wheel is uploaded with a different name just so it can be
224-
# manually downloaded when desired. The wheel itself *cannot* be tested
225-
# on the GHA runner, which uses x86_64 architecture.
226-
name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}-arm64.whl
233+
name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}.whl
227234
path: dist/*arm64.whl
228235
- name: Upload AccessControl wheel (all other platforms)
229236
if: >
@@ -241,6 +248,7 @@ jobs:
241248
&& startsWith(github.ref, 'refs/tags')
242249
&& !startsWith(runner.os, 'Linux')
243250
&& !startsWith(matrix.python-version, 'pypy')
251+
&& !startsWith(matrix.python-version, '3.13')
244252
env:
245253
TWINE_PASSWORD: ${{ secrets.TWINE_PASSWORD }}
246254
run: |
@@ -253,19 +261,13 @@ jobs:
253261
fail-fast: false
254262
matrix:
255263
python-version:
256-
- "3.7"
257264
- "3.8"
258265
- "3.9"
259266
- "3.10"
260267
- "3.11"
261268
- "3.12"
269+
- "3.13"
262270
os: [ubuntu-latest, macos-latest, windows-latest]
263-
exclude:
264-
- os: macos-latest
265-
python-version: "3.7"
266-
include:
267-
- python-version: "3.7"
268-
os: macos-12
269271

270272
steps:
271273
- name: checkout
@@ -274,6 +276,7 @@ jobs:
274276
uses: actions/setup-python@v5
275277
with:
276278
python-version: ${{ matrix.python-version }}
279+
allow-prereleases: true
277280
###
278281
# Caching.
279282
# This actually *restores* a cache and schedules a cleanup action
@@ -315,7 +318,23 @@ jobs:
315318
with:
316319
name: AccessControl-${{ runner.os }}-${{ matrix.python-version }}.whl
317320
path: dist/
321+
- name: Install AccessControl 3.13 ${{ matrix.python-version }}
322+
if: matrix.python-version == '3.13'
323+
run: |
324+
pip install -U wheel "setuptools<69"
325+
pip install --pre cffi
326+
# coverage might have a wheel on PyPI for a future python version which is
327+
# not ABI compatible with the current one, so build it from sdist:
328+
pip install -U --no-binary :all: coverage
329+
# Unzip into src/ so that testrunner can find the .so files
330+
# when we ask it to load tests from that directory. This
331+
# might also save some build time?
332+
unzip -n dist/AccessControl-*whl -d src
333+
# Use "--pre" here because dependencies with support for this future
334+
# Python release may only be available as pre-releases
335+
pip install --pre -U -e .[test]
318336
- name: Install AccessControl
337+
if: matrix.python-version != '3.13'
319338
run: |
320339
pip install -U wheel "setuptools<69"
321340
pip install -U coverage
@@ -370,6 +389,7 @@ jobs:
370389
uses: actions/setup-python@v5
371390
with:
372391
python-version: ${{ matrix.python-version }}
392+
allow-prereleases: true
373393
###
374394
# Caching.
375395
# This actually *restores* a cache and schedules a cleanup action
@@ -417,12 +437,9 @@ jobs:
417437
pip install -U wheel
418438
pip install -U `ls dist/AccessControl-*`[test]
419439
- name: Lint
420-
# We only need to do this on one version, and it should be Python 3, because
421-
# pylint has stopped updating for Python 2.
422-
# TODO: Pick a linter and configuration and make this step right.
423440
run: |
424-
pip install -U pylint
425-
# python -m pylint --limit-inference-results=1 --rcfile=.pylintrc AccessControl -f parseable -r n
441+
pip install -U tox
442+
tox -e lint
426443
427444
manylinux:
428445
runs-on: ubuntu-latest
@@ -440,6 +457,7 @@ jobs:
440457
uses: actions/setup-python@v5
441458
with:
442459
python-version: ${{ matrix.python-version }}
460+
allow-prereleases: true
443461
###
444462
# Caching.
445463
# This actually *restores* a cache and schedules a cleanup action

.manylinux-install.sh

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

2929
tox_env_map() {
3030
case $1 in
31-
*"cp37"*) echo 'py37';;
31+
*"cp313"*) echo 'py313';;
3232
*"cp38"*) echo 'py38';;
3333
*"cp39"*) echo 'py39';;
3434
*"cp310"*) echo 'py310';;
@@ -41,14 +41,19 @@ tox_env_map() {
4141
# Compile wheels
4242
for PYBIN in /opt/python/*/bin; do
4343
if \
44+
[[ "${PYBIN}" == *"cp313/"* ]] || \
4445
[[ "${PYBIN}" == *"cp311/"* ]] || \
4546
[[ "${PYBIN}" == *"cp312/"* ]] || \
46-
[[ "${PYBIN}" == *"cp37/"* ]] || \
4747
[[ "${PYBIN}" == *"cp38/"* ]] || \
4848
[[ "${PYBIN}" == *"cp39/"* ]] || \
4949
[[ "${PYBIN}" == *"cp310/"* ]] ; then
50-
"${PYBIN}/pip" install -e /io/
51-
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
50+
if [[ "${PYBIN}" == *"cp313/"* ]] ; then
51+
"${PYBIN}/pip" install --pre -e /io/
52+
"${PYBIN}/pip" wheel /io/ --pre -w wheelhouse/
53+
else
54+
"${PYBIN}/pip" install -e /io/
55+
"${PYBIN}/pip" wheel /io/ -w wheelhouse/
56+
fi
5257
if [ `uname -m` == 'aarch64' ]; then
5358
cd /io/
5459
${PYBIN}/pip install tox

.meta.toml

Lines changed: 5 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 = "4dc0484e"
5+
commit-id = "9f78efd3"
66

77
[python]
88
with-appveyor = false
99
with-windows = true
1010
with-pypy = false
11-
with-future-python = false
11+
with-future-python = true
1212
with-sphinx-doctests = false
1313
with-macos = false
1414
with-docs = false
@@ -37,3 +37,6 @@ additional-rules = [
3737
"recursive-include src *.h",
3838
"recursive-include src *.zcml",
3939
]
40+
41+
[c-code]
42+
require-cffi = true

CHANGES.rst

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,13 @@ Changelog
33

44
For changes before version 3.0, see ``HISTORY.rst``.
55

6-
6.4 (unreleased)
6+
7.0 (unreleased)
77
----------------
88

9+
- Add preliminary support for Python 3.13 as of 3.13b1.
10+
11+
- Remove support for Python 3.7.
12+
913
- Build Windows wheels on GHA.
1014

1115
- Make dict views (`.keys()`, `.items()` and `.values()`) behave like their

setup.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
join('include', 'Acquisition', 'Acquisition.h')]),
3333
]
3434

35-
version = '6.4.dev0'
35+
version = '7.0.dev0'
3636

3737

3838
setup(name='AccessControl',
@@ -60,12 +60,12 @@
6060
'Operating System :: OS Independent',
6161
'Programming Language :: Python',
6262
'Programming Language :: Python :: 3',
63-
'Programming Language :: Python :: 3.7',
6463
'Programming Language :: Python :: 3.8',
6564
'Programming Language :: Python :: 3.9',
6665
'Programming Language :: Python :: 3.10',
6766
'Programming Language :: Python :: 3.11',
6867
'Programming Language :: Python :: 3.12',
68+
'Programming Language :: Python :: 3.13',
6969
'Programming Language :: Python :: Implementation :: CPython',
7070
],
7171
ext_modules=ext_modules,
@@ -89,7 +89,7 @@
8989
'zope.testing',
9090
'funcsigs;python_version<"3.3"',
9191
],
92-
python_requires='>=3.7',
92+
python_requires='>=3.8',
9393
include_package_data=True,
9494
zip_safe=False,
9595
extras_require={

tox.ini

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,18 +4,19 @@
44
minversion = 4.0
55
envlist =
66
lint
7-
py37,py37-pure
87
py38,py38-pure
98
py39,py39-pure
109
py310,py310-pure
1110
py311,py311-pure
1211
py312,py312-pure
12+
py313,py313-pure
1313
coverage
1414

1515
[testenv]
1616
usedevelop = true
17+
pip_pre = py313: true
1718
deps =
18-
setuptools < 69
19+
setuptools < 69
1920
setenv =
2021
pure: PURE_PYTHON=1
2122
!pure-!pypy3: PURE_PYTHON=0

0 commit comments

Comments
 (0)