Skip to content

Commit 852c632

Browse files
authored
Merge pull request #69 from akhundMurad/fix/ci-cd
ci: let test-rust-accel run without pypi
2 parents ef41ae2 + 7a2eeef commit 852c632

File tree

6 files changed

+61
-11
lines changed

6 files changed

+61
-11
lines changed

.github/workflows/publish.yml

Lines changed: 26 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ jobs:
4545
command: build
4646
args: --release --out dist
4747
working-directory: rust-base32
48-
manylinux: auto
48+
manylinux: "2_28"
4949

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

5656
build-sdist:
@@ -83,10 +83,33 @@ jobs:
8383
with:
8484
name: sdist
8585
path: dist/*.tar.gz
86+
87+
build-rust-sdist:
88+
runs-on: ubuntu-latest
89+
needs: test
90+
steps:
91+
- uses: actions/checkout@v4
92+
- uses: actions/setup-python@v5
93+
with:
94+
python-version: "3.11"
95+
- uses: dtolnay/rust-toolchain@stable
96+
- name: Build rust sdist
97+
uses: PyO3/maturin-action@v1
98+
with:
99+
command: sdist
100+
args: --out dist
101+
working-directory: rust-base32
102+
103+
- uses: actions/upload-artifact@v4
104+
with:
105+
name: rust-sdist
106+
path: rust-base32/dist/*.tar.gz
86107

87108
publish-package:
88109
runs-on: ubuntu-latest
89-
needs: build-sdist
110+
needs:
111+
- build-sdist
112+
- build-rust-sdist
90113
permissions:
91114
contents: read
92115
id-token: write

.github/workflows/test.yml

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ jobs:
4848
4949
test-rust-accel:
5050
runs-on: ${{ matrix.os }}
51-
needs:
51+
needs:
5252
- test
5353
strategy:
5454
fail-fast: false
@@ -71,9 +71,9 @@ jobs:
7171
- name: Install uv
7272
uses: astral-sh/setup-uv@v3
7373

74-
- name: Sync deps (locked)
74+
- name: Sync deps (locked, no extras)
7575
run: |
76-
uv sync --locked --all-groups --all-extras
76+
uv sync --locked --all-groups
7777
7878
- name: Build & install Rust extension (maturin develop)
7979
uses: PyO3/maturin-action@v1
@@ -82,6 +82,13 @@ jobs:
8282
args: --release
8383
working-directory: rust-base32
8484

85+
# Install the remaining deps of the rust extra WITHOUT trying to fetch typeid-base32
86+
- name: Install rust extra deps (without fetching typeid-base32)
87+
shell: bash
88+
run: |
89+
uv pip install "uuid-utils>=0.12.0"
90+
uv pip install -e ".[rust]" --no-deps
91+
8592
- name: Sanity check (import extension)
8693
run: |
8794
uv run python -c "import typeid_base32; print('typeid_base32 OK')"

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ dependencies = ["uuid6>=2024.7.10,<2026.0.0"]
2727
[project.optional-dependencies]
2828
cli = ["click"]
2929
yaml = ["PyYAML"]
30-
rust = ["uuid-utils>=0.12.0", "typeid_base32>=0.3.5,<0.4.0"]
30+
rust = ["uuid-utils>=0.12.0", "typeid-base32>=0.3.5,<0.4.0"]
3131

3232
[project.urls]
3333
Homepage = "https://github.com/akhundMurad/typeid-python"

rust-base32/Cargo.lock

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

rust-base32/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
2-
name = "typeid_base32"
3-
version = "0.3.5"
2+
name = "typeid-base32"
3+
version = "0.3.6"
44
edition = "2021"
55

66
[lib]

rust-base32/pyproject.toml

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
[build-system]
2+
requires = ["maturin>=1.5"]
3+
build-backend = "maturin"
4+
5+
[project]
6+
name = "typeid-base32"
7+
version = "0.3.6"
8+
requires-python = ">=3.10"
9+
description = "Rust-accelerated base32 codec for typeid-python"
10+
license = { text = "MIT" }
11+
classifiers = [
12+
"Programming Language :: Python",
13+
"Programming Language :: Rust",
14+
"Operating System :: OS Independent",
15+
]
16+
17+
[tool.maturin]
18+
# This is the *import/module name* in Python: `import typeid_base32`
19+
module-name = "typeid_base32"
20+
features = ["pyo3/extension-module"]

0 commit comments

Comments
 (0)