Skip to content

Commit c250369

Browse files
committed
chore: support python 3.12
1 parent db0146c commit c250369

File tree

3 files changed

+13
-9
lines changed

3 files changed

+13
-9
lines changed

.github/workflows/ci.yml

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,8 @@ jobs:
1212
name: "Test"
1313
strategy:
1414
matrix:
15-
os: [ ubuntu-latest, macos-latest ]
16-
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
15+
os: [ubuntu-latest, macos-latest]
16+
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
1717
runs-on: "${{ matrix.os }}"
1818
steps:
1919
# Check out the code
@@ -116,7 +116,7 @@ jobs:
116116
- name: "Set up python"
117117
uses: "actions/setup-python@v4"
118118
with:
119-
python-version: "3.11"
119+
python-version: "3.12"
120120

121121
- name: "Get Python Path"
122122
id: get-py-path
@@ -217,6 +217,7 @@ jobs:
217217
- cp39
218218
- cp310
219219
- cp311
220+
- cp312
220221

221222
steps:
222223
- uses: actions/checkout@v3
@@ -252,7 +253,7 @@ jobs:
252253

253254
distribute:
254255
name: "Distribute Cargo, WASM, and Python Sdist Packages"
255-
needs: [ "build", "build-wheels" ]
256+
needs: ["build", "build-wheels"]
256257
runs-on: ubuntu-latest
257258
if: github.event_name == 'release' && github.event.action == 'published'
258259
steps:
@@ -263,7 +264,7 @@ jobs:
263264
- name: "Set up python"
264265
uses: "actions/setup-python@v4"
265266
with:
266-
python-version: "3.11"
267+
python-version: "3.12"
267268

268269
# Generate the lockfile
269270
- name: "Generate Cargo Lockfile"
@@ -355,7 +356,7 @@ jobs:
355356

356357
distribute-py-wheels:
357358
name: "Distribute Python Wheels"
358-
needs: [ "distribute" ]
359+
needs: ["distribute"]
359360
runs-on: ubuntu-latest
360361
# upload to PyPI on every tag starting with 'v'
361362
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')

build-wheels.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export PATH=/root/.cargo/bin:$PATH
1313

1414
mkdir -p build && rm -rf build/*
1515

16-
for PYBIN in /opt/python/{cp37-cp37m,cp38-cp38,cp39-cp39,cp310-cp310,cp311-cp311}/bin; do
16+
for PYBIN in /opt/python/{cp37-cp37m,cp38-cp38,cp39-cp39,cp310-cp310,cp311-cp311,cp312-cp312}/bin; do
1717
export PYTHON_SYS_EXECUTABLE="$PYBIN/python"
1818

1919
"${PYBIN}/python" -m ensurepip

setup.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
from pathlib import Path
2+
from subprocess import PIPE, Popen
3+
24
from setuptools import setup
35
from setuptools_rust import Binding, RustExtension
4-
from subprocess import Popen, PIPE
56

67
PKG_ROOT = Path(__file__).parent
78
SETUP_REQUIRES = ["setuptools-rust", "wheel", "setuptools"]
@@ -21,6 +22,7 @@ def generate_lockfile():
2122
raise RuntimeError(f"Could not generate Cargo lockfile: {err}")
2223
return
2324

25+
2426
def get_version():
2527
generate_lockfile()
2628
proc = Popen(("cargo", "pkgid"), stdout=PIPE, stderr=PIPE)
@@ -51,7 +53,7 @@ def get_version():
5153
classifiers=[
5254
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for all
5355
# available setup classifiers
54-
'Development Status :: 5 - Production/Stable',
56+
"Development Status :: 5 - Production/Stable",
5557
"Intended Audience :: Developers",
5658
"License :: OSI Approved :: MIT License",
5759
"Natural Language :: English",
@@ -65,6 +67,7 @@ def get_version():
6567
"Programming Language :: Python :: 3.9",
6668
"Programming Language :: Python :: 3.10",
6769
"Programming Language :: Python :: 3.11",
70+
"Programming Language :: Python :: 3.12",
6871
"Programming Language :: Rust",
6972
# 'Programming Language :: Python :: Implementation :: PyPy',
7073
],

0 commit comments

Comments
 (0)