Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 26 additions & 3 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,12 @@ jobs:
command: build
args: --release --out dist
working-directory: rust-base32
manylinux: auto
manylinux: "2_28"

- name: Upload wheels
uses: actions/upload-artifact@v4
with:
name: wheels-${{ matrix.os }}
name: wheels-${{ matrix.os }}-py${{ matrix.python-version }}
path: rust-base32/dist/*.whl

build-sdist:
Expand Down Expand Up @@ -83,10 +83,33 @@ jobs:
with:
name: sdist
path: dist/*.tar.gz

build-rust-sdist:
runs-on: ubuntu-latest
needs: test
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: dtolnay/rust-toolchain@stable
- name: Build rust sdist
uses: PyO3/maturin-action@v1
with:
command: sdist
args: --out dist
working-directory: rust-base32

- uses: actions/upload-artifact@v4
with:
name: rust-sdist
path: rust-base32/dist/*.tar.gz

publish-package:
runs-on: ubuntu-latest
needs: build-sdist
needs:
- build-sdist
- build-rust-sdist
permissions:
contents: read
id-token: write
Expand Down
13 changes: 10 additions & 3 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@ jobs:

test-rust-accel:
runs-on: ${{ matrix.os }}
needs:
needs:
- test
strategy:
fail-fast: false
Expand All @@ -71,9 +71,9 @@ jobs:
- name: Install uv
uses: astral-sh/setup-uv@v3

- name: Sync deps (locked)
- name: Sync deps (locked, no extras)
run: |
uv sync --locked --all-groups --all-extras
uv sync --locked --all-groups

- name: Build & install Rust extension (maturin develop)
uses: PyO3/maturin-action@v1
Expand All @@ -82,6 +82,13 @@ jobs:
args: --release
working-directory: rust-base32

# Install the remaining deps of the rust extra WITHOUT trying to fetch typeid-base32
- name: Install rust extra deps (without fetching typeid-base32)
shell: bash
run: |
uv pip install "uuid-utils>=0.12.0"
uv pip install -e ".[rust]" --no-deps

- name: Sanity check (import extension)
run: |
uv run python -c "import typeid_base32; print('typeid_base32 OK')"
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ dependencies = ["uuid6>=2024.7.10,<2026.0.0"]
[project.optional-dependencies]
cli = ["click"]
yaml = ["PyYAML"]
rust = ["uuid-utils>=0.12.0", "typeid_base32>=0.3.5,<0.4.0"]
rust = ["uuid-utils>=0.12.0", "typeid-base32>=0.3.5,<0.4.0"]

[project.urls]
Homepage = "https://github.com/akhundMurad/typeid-python"
Expand Down
4 changes: 2 additions & 2 deletions rust-base32/Cargo.lock

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

4 changes: 2 additions & 2 deletions rust-base32/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "typeid_base32"
version = "0.3.5"
name = "typeid-base32"
version = "0.3.6"
edition = "2021"

[lib]
Expand Down
20 changes: 20 additions & 0 deletions rust-base32/pyproject.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
[build-system]
requires = ["maturin>=1.5"]
build-backend = "maturin"

[project]
name = "typeid-base32"
version = "0.3.6"
requires-python = ">=3.10"
description = "Rust-accelerated base32 codec for typeid-python"
license = { text = "MIT" }
classifiers = [
"Programming Language :: Python",
"Programming Language :: Rust",
"Operating System :: OS Independent",
]

[tool.maturin]
# This is the *import/module name* in Python: `import typeid_base32`
module-name = "typeid_base32"
features = ["pyo3/extension-module"]