Skip to content

Commit 59f9595

Browse files
authored
Support Python 3.14 and 3.14t (#880)
* Support Python 3.14 and 3.14t * add trove classifiers * Depend on CFFI 2.0.0 final * delete unnecessary manylinux2014 excludes * remove beta versions * Revert "delete unnecessary manylinux2014 excludes" This reverts commit 95ecac5. * delete unnecessary manylinux2014 excludes
1 parent 2860f98 commit 59f9595

File tree

4 files changed

+87
-19
lines changed

4 files changed

+87
-19
lines changed
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
3+
<plist version="1.0">
4+
<array>
5+
<dict>
6+
<key>attributeSetting</key>
7+
<integer>1</integer>
8+
<key>choiceAttribute</key>
9+
<string>selected</string>
10+
<key>choiceIdentifier</key>
11+
<string>org.python.Python.PythonTFramework-3.14</string>
12+
</dict>
13+
</array>
14+
</plist>

.github/workflows/ci.yml

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,10 @@ jobs:
3030
- {VERSION: "3.11", NOXSESSION: "tests"}
3131
- {VERSION: "3.12", NOXSESSION: "tests"}
3232
- {VERSION: "3.13", NOXSESSION: "tests"}
33-
- {VERSION: "3.13", NOXSESSION: "tests", NOTE: "system", SODIUM_INSTALL: "system"}
34-
- {VERSION: "3.13", NOXSESSION: "tests", NOTE: "minimal", SODIUM_INSTALL_MINIMAL: "1"}
33+
- {VERSION: "3.14-dev", NOXSESSION: "tests"}
34+
- {VERSION: "3.14t-dev", NOXSESSION: "tests"}
35+
- {VERSION: "3.14-dev", NOXSESSION: "tests", NOTE: "system", SODIUM_INSTALL: "system"}
36+
- {VERSION: "3.14-dev", NOXSESSION: "tests", NOTE: "minimal", SODIUM_INSTALL_MINIMAL: "1"}
3537
name: "Linux ${{ matrix.PYTHON.VERSION }} ${{ matrix.PYTHON.NOXSESSION }} ${{ matrix.PYTHON.NOTE }}"
3638
steps:
3739
- uses: actions/[email protected]
@@ -71,8 +73,9 @@ jobs:
7173
- 'macos-latest'
7274
PYTHON:
7375
- {VERSION: "3.7", NOXSESSION: "tests"}
74-
- {VERSION: "3.13", NOXSESSION: "tests"}
75-
- {VERSION: "3.13", NOXSESSION: "tests", NOTE: " (minimal build)", SODIUM_INSTALL_MINIMAL: "1"}
76+
- {VERSION: "3.14-dev", NOXSESSION: "tests"}
77+
- {VERSION: "3.14t-dev", NOXSESSION: "tests"}
78+
- {VERSION: "3.14-dev", NOXSESSION: "tests", NOTE: " (minimal build)", SODIUM_INSTALL_MINIMAL: "1"}
7679
exclude:
7780
- PYTHON: {VERSION: "3.7", NOXSESSION: "tests"}
7881
RUNNER: macos-latest
@@ -100,7 +103,8 @@ jobs:
100103
- {ARCH: 'arm64', SODIUM_ARCH: 'ARM64', IMAGE: "windows-11-arm"}
101104
PYTHON:
102105
- {VERSION: "3.7", NOXSESSION: "tests", SODIUM_MSVC_VERSION: "v143"}
103-
- {VERSION: "3.13", NOXSESSION: "tests", SODIUM_MSVC_VERSION: "v143"}
106+
- {VERSION: "3.14-dev", NOXSESSION: "tests", SODIUM_MSVC_VERSION: "v143"}
107+
- {VERSION: "3.14t-dev", NOXSESSION: "tests", SODIUM_MSVC_VERSION: "v143"}
104108
exclude:
105109
- WINDOWS: {ARCH: 'arm64', SODIUM_ARCH: 'ARM64', IMAGE: "windows-11-arm"}
106110
PYTHON: {VERSION: "3.7", NOXSESSION: "tests", SODIUM_MSVC_VERSION: "v143"}

.github/workflows/wheel-builder.yml

Lines changed: 58 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,26 @@ jobs:
3030
matrix:
3131
PYTHON:
3232
- { VERSION: "cp37-cp37m", PATH: "/opt/python/cp311-cp311/bin/python", ABI_VERSION: 'cp37' }
33+
- { VERSION: "cp314-cp314t", PATH: "/opt/python/cp314-cp314t/bin/python" }
3334
MANYLINUX:
3435
- { NAME: "manylinux2014_x86_64", CONTAINER: "cryptography-manylinux2014:x86_64", RUNNER: "ubuntu-latest" }
3536
- { name: "manylinux_2_28_x86_64", CONTAINER: "cryptography-manylinux_2_28:x86_64", RUNNER: "ubuntu-latest" }
3637
- { name: "manylinux_2_34_x86_64", CONTAINER: "cryptography-manylinux_2_34:x86_64", RUNNER: "ubuntu-latest" }
3738
- { name: "musllinux_1_1_x86_64", CONTAINER: "cryptography-musllinux_1_1:x86_64", RUNNER: "ubuntu-latest" }
39+
- { name: "musllinux_1_2_x86_64", CONTAINER: "cryptography-musllinux_1_2:x86_64", RUNNER: "ubuntu-latest" }
3840

3941
- { NAME: "manylinux2014_aarch64", CONTAINER: "cryptography-manylinux2014_aarch64", RUNNER: "ubuntu-24.04-arm" }
4042
- { name: "manylinux_2_28_aarch64", CONTAINER: "cryptography-manylinux_2_28:aarch64", RUNNER: "ubuntu-24.04-arm" }
4143
- { name: "manylinux_2_34_aarch64", CONTAINER: "cryptography-manylinux_2_34:aarch64", RUNNER: "ubuntu-24.04-arm" }
4244
- { name: "musllinux_1_1_aarch64", CONTAINER: "cryptography-musllinux_1_1:aarch64", RUNNER: "ubuntu-24.04-arm" }
45+
- { name: "musllinux_1_2_aarch64", CONTAINER: "cryptography-musllinux_1_2:aarch64", RUNNER: "ubuntu-24.04-arm" }
46+
exclude:
47+
# musllinux 1_1 doesn't have python 3.14 builds
48+
- PYTHON: { VERSION: "cp314-cp314t", PATH: "/opt/python/cp314-cp314t/bin/python" }
49+
MANYLINUX: { name: "musllinux_1_1_x86_64", CONTAINER: "cryptography-musllinux_1_1:x86_64", RUNNER: "ubuntu-latest" }
50+
- PYTHON: { VERSION: "cp314-cp314t", PATH: "/opt/python/cp314-cp314t/bin/python" }
51+
MANYLINUX: { name: "musllinux_1_1_aarch64", CONTAINER: "cryptography-musllinux_1_1:aarch64", RUNNER: "ubuntu-24.04-arm" }
52+
4353

4454
name: "${{ matrix.PYTHON.VERSION }} for ${{ matrix.MANYLINUX.NAME }}"
4555
steps:
@@ -61,11 +71,18 @@ jobs:
6171
ref: ${{ github.event.inputs.version || github.ref }}
6272
persist-credentials: false
6373
- run: ${{ matrix.PYTHON.PATH }} -m venv .venv
64-
- name: Install python dependencies
65-
run: .venv/bin/pip install -U pip cffi wheel build
66-
- run: |
74+
- run: .venv/bin/pip install -U pip wheel cffi build
75+
if: matrix.PYTHON.VERSION != 'cp314-cp314t'
76+
- run: .venv/bin/pip install -U pip wheel 'cffi>=2.0.0' build
77+
if: matrix.PYTHON.VERSION == 'cp314-cp314t'
78+
- name: Build the wheel
79+
run: |
80+
if [ -n "${{ matrix.PYTHON.ABI_VERSION }}" ]; then
81+
PY_LIMITED_API="--config-setting=--build-option=--py-limited-api=${{ matrix.PYTHON.ABI_VERSION }}"
82+
fi
83+
6784
mkdir tmpwheelhouse
68-
LIBSODIUM_MAKE_ARGS="-j$(nproc)" .venv/bin/python -m build --wheel --config-setting=--build-option=--py-limited-api=${{ matrix.PYTHON.ABI_VERSION }}
85+
LIBSODIUM_MAKE_ARGS="-j$(nproc)" .venv/bin/python -m build --wheel $PY_LIMITED_API
6986
mv dist/pynacl*.whl tmpwheelhouse/
7087
- run: auditwheel repair --plat ${{ matrix.MANYLINUX.NAME }} tmpwheelhouse/pynacl*.whl -w wheelhouse/
7188
- run: .venv/bin/pip install pynacl --no-index -f wheelhouse/
@@ -88,7 +105,10 @@ jobs:
88105
ABI_VERSION: 'cp37'
89106
DOWNLOAD_URL: 'https://www.python.org/ftp/python/3.10.1/python-3.10.1-macos11.pkg'
90107
BIN_PATH: '/Library/Frameworks/Python.framework/Versions/3.10/bin/python3'
91-
name: "Python ${{ matrix.PYTHON.VERSION }} for ABI ${{ matrix.PYTHON.ABI_VERSION }} on macOS"
108+
- VERSION: '3.14t-dev'
109+
DOWNLOAD_URL: 'https://www.python.org/ftp/python/3.14.0/python-3.14.0rc1-macos11.pkg'
110+
BIN_PATH: '/Library/Frameworks/PythonT.framework/Versions/3.14/bin/python3.14t'
111+
name: "Python ${{ matrix.PYTHON.VERSION }} ${{ matrix.PYTHON.ABI_VERSION }} on macOS"
92112
steps:
93113
- uses: actions/[email protected]
94114
with:
@@ -100,17 +120,28 @@ jobs:
100120
sudo installer -pkg python.pkg -target /
101121
env:
102122
PYTHON_DOWNLOAD_URL: ${{ matrix.PYTHON.DOWNLOAD_URL }}
123+
if: matrix.PYTHON.VERSION != '3.14t-dev'
124+
- run: |
125+
curl "$PYTHON_DOWNLOAD_URL" -o python.pkg
126+
sudo installer -pkg python.pkg -applyChoiceChangesXML .github/config/macos-pkg-choices-freethreaded.xml -target /
127+
env:
128+
PYTHON_DOWNLOAD_URL: ${{ matrix.PYTHON.DOWNLOAD_URL }}
129+
if: matrix.PYTHON.VERSION == '3.14t-dev'
103130
- run: ${{ matrix.PYTHON.BIN_PATH }} -m pip install -U virtualenv
104131
- run: ${{ matrix.PYTHON.BIN_PATH }} -m virtualenv venv
105132
- run: venv/bin/pip install -U pip wheel cffi build
133+
if: matrix.PYTHON.VERSION != '3.14t-dev'
134+
- run: venv/bin/pip install -U pip wheel 'cffi>=2.0.0' build
135+
if: matrix.PYTHON.VERSION == '3.14t-dev'
106136
- name: Build the wheel
107137
run: |
138+
if [ -n "${{ matrix.PYTHON.ABI_VERSION }}" ]; then
139+
PY_LIMITED_API="--config-setting=--build-option=--py-limited-api=${{ matrix.PYTHON.ABI_VERSION }}"
140+
fi
108141
mkdir wheelhouse
109-
LIBSODIUM_MAKE_ARGS="-j$(sysctl -n hw.ncpu)" \
110-
venv/bin/python -m build --wheel --config-setting=--build-option=--py-limited-api=${{ matrix.PYTHON.ABI_VERSION }}
111-
mv dist/pynacl*.whl wheelhouse/
142+
LIBSODIUM_MAKE_ARGS="-j$(sysctl -n hw.ncpu)" venv/bin/python -m build --wheel $PY_LIMITED_API
143+
mv dist/pynacl*.whl wheelhouse/
112144
env:
113-
PYTHON_VERSION: ${{ matrix.PYTHON.ABI_VERSION }}
114145
MACOSX_DEPLOYMENT_TARGET: '10.10'
115146
CFLAGS: '-arch arm64 -arch x86_64'
116147
ARCHFLAGS: '-arch arm64 -arch x86_64'
@@ -136,6 +167,12 @@ jobs:
136167
PYTHON: {VERSION: '3.9', ABI_VERSION: 'cp37', SODIUM_MSVC_VERSION: 'v143'}
137168
- WINDOWS: {ARCH: 'arm64', SODIUM_ARCH: 'ARM64', VS_ARCH: 'arm64', IMAGE: 'windows-11-arm'}
138169
PYTHON: {VERSION: '3.11', ABI_VERSION: 'cp37', SODIUM_MSVC_VERSION: 'v143'}
170+
- WINDOWS: {ARCH: 'x86', SODIUM_ARCH: 'Win32', VS_ARCH: 'x86', IMAGE: 'windows-latest'}
171+
PYTHON: {VERSION: '3.14t-dev', SODIUM_MSVC_VERSION: 'v143'}
172+
- WINDOWS: {ARCH: 'x64', SODIUM_ARCH: 'x64', VS_ARCH: 'amd64', IMAGE: 'windows-latest'}
173+
PYTHON: {VERSION: '3.14t-dev', SODIUM_MSVC_VERSION: 'v143'}
174+
- WINDOWS: {ARCH: 'arm64', SODIUM_ARCH: 'ARM64', VS_ARCH: 'arm64', IMAGE: 'windows-11-arm'}
175+
PYTHON: {VERSION: '3.14t-dev', SODIUM_MSVC_VERSION: 'v143'}
139176
name: "${{ matrix.PYTHON.VERSION }} ${{ matrix.WINDOWS.ARCH }} ${{ matrix.PYTHON.ABI_VERSION }}"
140177
steps:
141178
- uses: actions/[email protected]
@@ -158,13 +195,22 @@ jobs:
158195
echo "LIB=C:/libsodium/${{ matrix.WINDOWS.SODIUM_ARCH }}/release/${{ matrix.PYTHON.SODIUM_MSVC_VERSION }}/static;$LIB" >> $GITHUB_ENV
159196
shell: bash
160197

161-
- name: Install wheel and our Python dependencies
162-
run: python -m pip install -U pip wheel cffi build
198+
- run: python -m pip install -U pip wheel cffi build
199+
if: matrix.PYTHON.VERSION != '3.14t-dev'
200+
- run: python -m pip install -U pip wheel 'cffi>=2.0.0' build
201+
if: matrix.PYTHON.VERSION == '3.14t-dev'
202+
- name: Determine PY_LIMITED_API
203+
run: |
204+
if [ -n "${{ matrix.PYTHON.ABI_VERSION }}" ]; then
205+
PY_LIMITED_API="--config-setting=--build-option=--py-limited-api=${{ matrix.PYTHON.ABI_VERSION }}"
206+
fi
207+
echo "PY_LIMITED_API=$PY_LIMITED_API" >> $GITHUB_ENV
208+
shell: bash
163209
- name: Build the wheel
164210
run: |
165211
mkdir wheelhouse
166212
call "C:\Program Files\Microsoft Visual Studio\2022\Enterprise\Common7\Tools\VsDevCmd.bat" -no_logo -arch=${{ matrix.WINDOWS.VS_ARCH }}
167-
python -m build --wheel --config-setting=--build-option=--py-limited-api=${{ matrix.PYTHON.ABI_VERSION }}
213+
python -m build --wheel %PY_LIMITED_API%
168214
mv dist/pynacl*.whl wheelhouse/
169215
shell: cmd
170216
env:

pyproject.toml

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,8 @@
33
requires = [
44
"setuptools>=61.0.0,!=74.0.0",
55
"wheel",
6-
"cffi>=1.4.1; platform_python_implementation != 'PyPy'",
6+
"cffi>=1.4.1; platform_python_implementation != 'PyPy' and python_version < '3.14'",
7+
"cffi>=2.0.0; platform_python_implementation != 'PyPy' and python_version >= '3.14'",
78
]
89
build-backend = "setuptools.build_meta"
910

@@ -22,6 +23,7 @@ classifiers = [
2223
"License :: OSI Approved :: Apache Software License",
2324
"Programming Language :: Python :: Implementation :: CPython",
2425
"Programming Language :: Python :: Implementation :: PyPy",
26+
"Programming Language :: Python :: Free Threading :: 3 - Stable",
2527
"Programming Language :: Python :: 3",
2628
"Programming Language :: Python :: 3.7",
2729
"Programming Language :: Python :: 3.8",
@@ -30,10 +32,12 @@ classifiers = [
3032
"Programming Language :: Python :: 3.11",
3133
"Programming Language :: Python :: 3.12",
3234
"Programming Language :: Python :: 3.13",
35+
"Programming Language :: Python :: 3.14",
3336
]
3437
requires-python = ">=3.7"
3538
dependencies = [
36-
"cffi>=1.4.1; platform_python_implementation != 'PyPy'"
39+
"cffi>=1.4.1; platform_python_implementation != 'PyPy' and python_version < '3.14'",
40+
"cffi>=2.0.0; platform_python_implementation != 'PyPy' and python_version >= '3.14'",
3741
]
3842

3943
[project.optional-dependencies]

0 commit comments

Comments
 (0)