Skip to content

Commit

Permalink
Add support for python 3.13 (#71)
Browse files Browse the repository at this point in the history
  • Loading branch information
king-phyte authored Nov 4, 2024
1 parent 3ff08f6 commit 600c38b
Show file tree
Hide file tree
Showing 5 changed files with 69 additions and 74 deletions.
99 changes: 50 additions & 49 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
name: Check code quality
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.10"
python-version: "3.12"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Check code
Expand All @@ -33,17 +33,17 @@ jobs:
strategy:
matrix:
target: [x86_64, i686]
python-version: ["3.10", "3.11", "3.12"]
python-version: ["3.10", "3.11", "3.12", "3.13"]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python-version }}"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
target: ${{ matrix.target }}
args: --release --out dist -i 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9
args: --release --out dist -i 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
sccache: "true"
manylinux: auto
- name: Install and test
Expand All @@ -53,9 +53,9 @@ jobs:
pip install pytest
pytest -v .
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-linux-${{ strategy.job-index }}
path: dist

linux-cross:
Expand All @@ -65,23 +65,23 @@ jobs:
matrix:
target: [aarch64, armv7, ppc64le]
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
rust-toolchain: stable
target: ${{ matrix.target }}
manylinux: auto
args: --release --out dist -i 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9
- uses: uraimo/run-on-arch-action@v2.7.2
args: --release --out dist -i 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
- uses: uraimo/run-on-arch-action@v2.8.1
if: matrix.target != 'ppc64'
name: Install built wheel
with:
arch: ${{ matrix.target }}
distro: ubuntu20.04
distro: ubuntu22.04
githubToken: ${{ github.token }}
install: |
apt-get update
Expand All @@ -91,9 +91,9 @@ jobs:
pip3 install uuid_utils --no-index --find-links dist/ --force-reinstall
pytest -v .
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-linux-cross-${{ strategy.job-index }}
path: dist

musllinux:
Expand All @@ -105,18 +105,18 @@ jobs:
- x86_64-unknown-linux-musl
- i686-unknown-linux-musl
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
architecture: x64
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
rust-toolchain: stable
target: ${{ matrix.target }}
manylinux: musllinux_1_2
args: --release --out dist -i 3.8 3.9 3.10 3.11 3.12
args: --release --out dist -i 3.9 3.10 3.11 3.12 3.13
- name: Install built wheel
if: matrix.target == 'x86_64-unknown-linux-musl'
uses: addnab/docker-run-action@v3
Expand All @@ -129,9 +129,9 @@ jobs:
pip3 install uuid_utils --no-index --find-links /io/dist/ --force-reinstall --break-system-packages
python3 -c "import uuid_utils"
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-musllinux-${{ strategy.job-index }}
path: dist

musllinux-cross:
Expand All @@ -143,21 +143,21 @@ jobs:
- target: aarch64-unknown-linux-musl
arch: aarch64
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- name: Build wheels
uses: PyO3/maturin-action@v1
with:
rust-toolchain: stable
target: ${{ matrix.platform.target }}
manylinux: musllinux_1_2
args: --release --out dist -i 3.8 3.9 3.10 3.11 3.12
args: --release --out dist -i 3.9 3.10 3.11 3.12 3.13
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-musllinux-cross-${{ strategy.job-index }}
path: dist

windows:
Expand All @@ -167,14 +167,14 @@ jobs:
matrix:
platform:
- target: x64
interpreter: 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9
interpreter: 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
- target: x86
interpreter: 3.8 3.9 3.10 3.11
interpreter: 3.9 3.10 3.11 3.12
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
architecture: ${{ matrix.platform.target }}
- uses: dtolnay/rust-toolchain@stable
- name: Build wheels
Expand All @@ -189,56 +189,56 @@ jobs:
pip install pytest
pytest -v .
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-windows-${{ strategy.job-index }}
path: dist

macos:
name: "MacOS"
runs-on: macos-latest
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
python-version: "3.12"
- uses: dtolnay/rust-toolchain@stable
- name: Build wheels - x86_64
uses: PyO3/maturin-action@v1
with:
target: x86_64
args: --release --out dist -i 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9
args: --release --out dist -i 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
sccache: "true"
- name: Build wheels - universal2
uses: PyO3/maturin-action@v1
with:
target: universal2-apple-darwin
args: --release --out dist -i 3.8 3.9 3.10 3.11 3.12 pypy3.8 pypy3.9
args: --release --out dist -i 3.9 3.10 3.11 3.12 3.13 pypy3.9 pypy3.10
- name: Install and test uuid_utils
run: |
pip install uuid_utils --no-index --find-links dist --force-reinstall
pip install pytest
pytest -v .
- name: Upload wheels
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-macos
path: dist

sdist:
name: Source Distribution
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
- name: Upload sdist
uses: actions/upload-artifact@v3
uses: actions/upload-artifact@v4
with:
name: wheels
name: wheels-sdist
path: dist

release:
Expand All @@ -247,9 +247,10 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
needs: [lint, linux, linux-cross, musllinux, musllinux-cross, windows, macos, sdist]
steps:
- uses: actions/download-artifact@v4.1.7
- uses: actions/download-artifact@v4.1.8
with:
name: wheels
pattern: wheels-*
merge-multiple: true
- name: Publish to PyPI
uses: PyO3/maturin-action@v1
env:
Expand All @@ -264,7 +265,7 @@ jobs:
if: "startsWith(github.ref, 'refs/tags/')"
needs: [release]
steps:
- uses: actions/checkout@v3
- uses: actions/checkout@v4
- name: Build and publish docs
run: |
pip install -r requirements.txt
Expand Down
26 changes: 13 additions & 13 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 3 additions & 3 deletions Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "uuid-utils"
version = "0.9.0"
version = "0.10.0"
edition = "2021"

[lib]
Expand All @@ -9,6 +9,6 @@ crate-type = ["cdylib"]

[dependencies]
mac_address = "1.1.7"
pyo3 = { version = "0.22.2", features = ["extension-module", "generate-import-lib", 'abi3-py38'] }
pyo3 = { version = "0.22.5", features = ["extension-module", "generate-import-lib", 'abi3-py39'] }
rand = "0.8.5"
uuid = { version = "1.10.0", features = ["v1", "v3", "v4", "v5", "v6", "v7", "v8", "fast-rng"]}
uuid = { version = "1.11.0", features = ["v1", "v3", "v4", "v5", "v6", "v7", "v8", "fast-rng"]}
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,17 +7,17 @@ name = "uuid_utils"
description = "Drop-in replacement for Python UUID in Rust"
authors = [{ name = "Amin Alaee", email = "me@aminalaee.dev" }]
keywords = ["rust", "uuid"]
requires-python = ">=3.8"
requires-python = ">=3.9"
classifiers = [
"Development Status :: 3 - Alpha",
"Programming Language :: Python",
"Programming Language :: Python :: 3",
"Programming Language :: Python :: 3 :: Only",
"Programming Language :: Python :: 3.8",
"Programming Language :: Python :: 3.9",
"Programming Language :: Python :: 3.10",
"Programming Language :: Python :: 3.11",
"Programming Language :: Python :: 3.12",
"Programming Language :: Python :: 3.13",
"Programming Language :: Rust",
"Intended Audience :: Developers",
"License :: OSI Approved :: BSD License",
Expand Down
Loading

0 comments on commit 600c38b

Please sign in to comment.