Skip to content

Commit a2bc2a1

Browse files
authored
Merge pull request #41 from zodb/315-freethread
Add Python 3.15 and free-threaded support
2 parents d5e1945 + be6b8cf commit a2bc2a1

8 files changed

Lines changed: 54 additions & 31 deletions

File tree

.github/workflows/tests.yml

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,16 @@ jobs:
8181
runs-on: ${{ matrix.os }}
8282
strategy:
8383
matrix:
84-
python-version: [pypy-3.11, '3.10', '3.11', "3.12", "3.13", "3.14.0-rc.3"]
84+
python-version:
85+
- pypy-3.11
86+
- '3.10'
87+
- '3.11'
88+
- "3.12"
89+
- "3.13"
90+
- "3.14"
91+
- "3.15-dev"
92+
- "3.14t"
93+
- "3.15t-dev"
8594
os: [ubuntu-latest, macos-latest]
8695
exclude:
8796
- os: macos-latest
@@ -101,8 +110,14 @@ jobs:
101110
run: |
102111
pip install -U pip
103112
pip install -U setuptools wheel twine build
104-
pip install -U 'cython>=3.0.10'
113+
pip install -U 'cython>=3.2.4'
105114
pip install -U coverage
115+
- name: Disable GIL
116+
if: ${{endsWith(matrix.python-version, 't') || endsWith(matrix.python-version, 't-dev')}}
117+
# zope.i18nmessageid
118+
run: |
119+
echo PYTHON_GIL=0 >> $GITHUB_ENV
120+
106121
- name: Install perfmetrics (non-Mac)
107122
if: ${{ ! startsWith(runner.os, 'Mac') }}
108123
run: |
@@ -129,12 +144,13 @@ jobs:
129144
ARCHFLAGS: "-arch x86_64 -arch arm64"
130145

131146
- name: Check perfmetrics build
147+
if: matrix.python-version == '3.14' && startsWith(runner.os, 'Linux')
132148
run: |
133149
ls -l dist
134150
twine check dist/*
135151
136152
- name: Upload perfmetrics wheel
137-
uses: actions/upload-artifact@v6
153+
uses: actions/upload-artifact@v7
138154
with:
139155
name: perfmetrics-${{ runner.os }}-${{ matrix.python-version }}.whl
140156
path: dist/*whl
@@ -157,8 +173,7 @@ jobs:
157173
twine upload --skip-existing dist/*
158174
159175
- name: lint
160-
if: matrix.python-version == '3.11' && startsWith(runner.os, 'Linux')
161-
# At this writing, PyLint 2.17/astroid 2.15 won't work on 3.12
176+
if: matrix.python-version == '3.14' && startsWith(runner.os, 'Linux')
162177
run: |
163178
pip install -U pylint
164179
python -m pylint --limit-inference-results=1 --rcfile=.pylintrc perfmetrics -f parseable -r n
@@ -168,12 +183,12 @@ jobs:
168183
# We use a regular Python matrix entry to share as much code as possible.
169184
strategy:
170185
matrix:
171-
python-version: [3.11]
186+
python-version: [3.14]
172187
image:
173-
- manylinux2014_aarch64
174-
- manylinux2014_ppc64le
175-
- manylinux2014_s390x
176-
- manylinux2014_x86_64
188+
- manylinux_2_28_x86_64
189+
- manylinux_2_28_aarch64
190+
# - manylinux_2_28_ppc64le
191+
# - manylinux_2_28_s390x
177192
- musllinux_1_2_x86_64
178193
- musllinux_1_2_aarch64
179194
name: ${{ matrix.image }}
@@ -185,20 +200,20 @@ jobs:
185200
with:
186201
python-version: ${{ matrix.python-version }}
187202
- name: Set up QEMU
188-
uses: docker/setup-qemu-action@v3
203+
uses: docker/setup-qemu-action@v4
189204
with:
190205
platforms: all
191206
- name: Build and test perfmetrics
192207
env:
193208
DOCKER_IMAGE: quay.io/pypa/${{ matrix.image }}
194209
run: bash ./scripts/releases/make-manylinux
195210
- name: Store perfmetrics wheels
196-
uses: actions/upload-artifact@v6
211+
uses: actions/upload-artifact@v7
197212
with:
198213
path: wheelhouse/*whl
199214
name: ${{ matrix.image }}_wheels.zip
200215
- name: Publish package to PyPI
201-
uses: pypa/gh-action-pypi-publish@v1.13.0
216+
uses: pypa/gh-action-pypi-publish@v1.14.0
202217
if: github.event_name == 'push' && startsWith(github.ref, 'refs/tags')
203218
with:
204219
user: __token__

.readthedocs.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ sphinx:
2121
build:
2222
os: ubuntu-22.04
2323
tools:
24-
python: "3.11"
24+
python: "3.14"
2525
# You can also specify other tool versions:
2626
# nodejs: "19"
2727
# rust: "1.64"

CHANGES.rst

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,13 @@
22
CHANGES
33
=========
44

5-
4.2.1 (unreleased)
5+
4.3.0 (unreleased)
66
==================
77

8-
- Nothing changed yet.
8+
- Add support for Python 3.15. This will be the last major release to
9+
support Python 3.10.
10+
- Add support for free-threaded Python 3.14 and 3.15.
11+
- Remove dependency on ``setuptools``.
912

1013

1114
4.2.0 (2025-09-19)

docs/conf.py

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,11 @@
3232

3333
import os
3434
import sys
35-
import pkg_resources
35+
import importlib.metadata
3636
os.environ['PURE_PYTHON'] = '1'
3737

3838
sys.path.append(os.path.abspath('../src'))
39-
rqmt = pkg_resources.require('perfmetrics')[0]
40-
39+
rqmt = importlib.metadata.version('perfmetrics')
4140

4241

4342
extensions = [
@@ -77,9 +76,9 @@
7776
# built documents.
7877
#
7978
# The short X.Y version.
80-
version = '%s.%s' % tuple(map(int, rqmt.version.split('.')[:2]))
79+
version = '%s.%s' % tuple(map(int, rqmt.split('.')[:2]))
8180
# The full version, including alpha/beta/rc tags.
82-
release = rqmt.version
81+
release = rqmt
8382

8483
# The language for content autogenerated by Sphinx. Refer to documentation
8584
# for a list of supported languages.

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,5 +19,5 @@ requires = [
1919
# failing in Python 2 (https://travis-ci.org/github/gevent/gevent/jobs/683782800);
2020
# This was fixed in 3.0a5 (https://github.com/cython/cython/issues/3578)
2121
# 3.0a6 fixes an issue cythonizing source on 32-bit platforms
22-
"Cython >= 3.0.10; platform_python_implementation == 'CPython'",
22+
"Cython >= 3.2.4; platform_python_implementation == 'CPython'",
2323
]

scripts/releases/make-manylinux

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ export PYTHONDONTWRITEBYTECODE=1
1010
# know. The env var works for pip 20.
1111
export PIP_NO_PYTHON_VERSION_WARNING=1
1212
export PIP_NO_WARN_SCRIPT_LOCATION=1
13+
export PIP_ROOT_USER_ACTION=ignore
1314

1415
# Build configuration.
1516
export CFLAGS="-pipe -O3 -DNDEBUG"
@@ -22,12 +23,8 @@ if [ -d /io -a -d /opt/python ]; then
2223
cd /io
2324
rm -rf wheelhouse
2425
mkdir wheelhouse
25-
for variant in /opt/python/cp{314,313,312,310,311}*; do
26+
for variant in /opt/python/cp{315,314,313,312,310,311}*; do
2627
echo $SEP
27-
if [[ "$variant" == *t ]]; then
28-
echo "Skipping no-gil build. The GIL is required."
29-
continue
30-
fi
3128
echo "Building $variant"
3229
mkdir /tmp/build
3330
cd /tmp/build
@@ -46,5 +43,5 @@ if [ -d /io -a -d /opt/python ]; then
4643
exit 0
4744
fi
4845

49-
docker run --rm -e GITHUB_ACTIONS -e DOCKER_IMAGE -v "$(pwd):/io" ${DOCKER_IMAGE:-quay.io/pypa/manylinux2014_x86_64} /io/scripts/releases/$(basename $0)
46+
docker run --rm -e GITHUB_ACTIONS -e DOCKER_IMAGE -v "$(pwd):/io" ${DOCKER_IMAGE:-quay.io/pypa/manylinux_2_28_x86_64} /io/scripts/releases/$(basename $0)
5047
ls -l wheelhouse

setup.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,7 @@ def _c(m):
110110
'language_level': '3str',
111111
'always_allow_keywords': False,
112112
'nonecheck': False,
113+
'freethreading_compatible': True,
113114
},
114115
)
115116
except ValueError:
@@ -124,7 +125,7 @@ def _c(m):
124125

125126
setup(
126127
name='perfmetrics',
127-
version='4.2.1.dev0',
128+
version='4.3.0.dev0',
128129
author='Shane Hathaway',
129130
author_email='shane@hathawaymix.org',
130131
maintainer='Jason Madden',
@@ -144,6 +145,7 @@ def _c(m):
144145
"Programming Language :: Python :: 3.12",
145146
"Programming Language :: Python :: 3.13",
146147
"Programming Language :: Python :: 3.14",
148+
"Programming Language :: Python :: 3.15",
147149
"Programming Language :: Python :: Implementation :: CPython",
148150
"Programming Language :: Python :: Implementation :: PyPy",
149151
"License :: Repoze Public License",
@@ -163,7 +165,6 @@ def _c(m):
163165
zip_safe=True,
164166
tests_require=tests_require,
165167
install_requires=[
166-
'setuptools',
167168
],
168169
extras_require={
169170
'test': tests_require,

tox.ini

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[tox]
2-
envlist = py37,py38,py39,py310,py311,py312,py313,pypy3,py37,coverage
2+
envlist = py310,py311,py312,py313,py314,py315,py315t,py314t,pypy3,coverage
33

44
[testenv]
55
extras =
@@ -20,6 +20,14 @@ deps =
2020
coverage
2121

2222

23+
[testenv:py314t]
24+
setenv:
25+
PYTHON_GIL=0
26+
27+
[testenv:py315t]
28+
setenv:
29+
PYTHON_GIL=0
30+
2331
[testenv:docs]
2432
commands =
2533
sphinx-build -b html -d docs/_build/doctrees docs docs/_build/html

0 commit comments

Comments
 (0)