Skip to content

Commit

Permalink
chore: support python 3.12
Browse files Browse the repository at this point in the history
  • Loading branch information
gquittet committed Apr 15, 2024
1 parent db0146c commit c250369
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 9 deletions.
13 changes: 7 additions & 6 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,8 @@ jobs:
name: "Test"
strategy:
matrix:
os: [ ubuntu-latest, macos-latest ]
python-version: [ "3.7", "3.8", "3.9", "3.10", "3.11" ]
os: [ubuntu-latest, macos-latest]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]
runs-on: "${{ matrix.os }}"
steps:
# Check out the code
Expand Down Expand Up @@ -116,7 +116,7 @@ jobs:
- name: "Set up python"
uses: "actions/setup-python@v4"
with:
python-version: "3.11"
python-version: "3.12"

- name: "Get Python Path"
id: get-py-path
Expand Down Expand Up @@ -217,6 +217,7 @@ jobs:
- cp39
- cp310
- cp311
- cp312

steps:
- uses: actions/checkout@v3
Expand Down Expand Up @@ -252,7 +253,7 @@ jobs:

distribute:
name: "Distribute Cargo, WASM, and Python Sdist Packages"
needs: [ "build", "build-wheels" ]
needs: ["build", "build-wheels"]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published'
steps:
Expand All @@ -263,7 +264,7 @@ jobs:
- name: "Set up python"
uses: "actions/setup-python@v4"
with:
python-version: "3.11"
python-version: "3.12"

# Generate the lockfile
- name: "Generate Cargo Lockfile"
Expand Down Expand Up @@ -355,7 +356,7 @@ jobs:

distribute-py-wheels:
name: "Distribute Python Wheels"
needs: [ "distribute" ]
needs: ["distribute"]
runs-on: ubuntu-latest
# upload to PyPI on every tag starting with 'v'
# if: github.event_name == 'push' && startsWith(github.event.ref, 'refs/tags/v')
Expand Down
2 changes: 1 addition & 1 deletion build-wheels.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export PATH=/root/.cargo/bin:$PATH

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

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

"${PYBIN}/python" -m ensurepip
Expand Down
7 changes: 5 additions & 2 deletions setup.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
from pathlib import Path
from subprocess import PIPE, Popen

from setuptools import setup
from setuptools_rust import Binding, RustExtension
from subprocess import Popen, PIPE

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


def get_version():
generate_lockfile()
proc = Popen(("cargo", "pkgid"), stdout=PIPE, stderr=PIPE)
Expand Down Expand Up @@ -51,7 +53,7 @@ def get_version():
classifiers=[
# See https://pypi.python.org/pypi?%3Aaction=list_classifiers for all
# available setup classifiers
'Development Status :: 5 - Production/Stable',
"Development Status :: 5 - Production/Stable",
"Intended Audience :: Developers",
"License :: OSI Approved :: MIT License",
"Natural Language :: English",
Expand All @@ -65,6 +67,7 @@ def get_version():
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Rust",
# 'Programming Language :: Python :: Implementation :: PyPy',
],
Expand Down

0 comments on commit c250369

Please sign in to comment.