diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 63a9b9d..94cd41a 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -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: @@ -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 diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index ed8cc43..784fcba 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -48,7 +48,7 @@ jobs: test-rust-accel: runs-on: ${{ matrix.os }} - needs: + needs: - test strategy: fail-fast: false @@ -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 @@ -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')" diff --git a/pyproject.toml b/pyproject.toml index 18e0f1e..10b775b 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" diff --git a/rust-base32/Cargo.lock b/rust-base32/Cargo.lock index 116c7c3..487a7f8 100644 --- a/rust-base32/Cargo.lock +++ b/rust-base32/Cargo.lock @@ -153,8 +153,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b1dd07eb858a2067e2f3c7155d54e929265c264e6f37efe3ee7a8d1b5a1dd0ba" [[package]] -name = "typeid_base32" -version = "0.3.5" +name = "typeid-base32" +version = "0.3.6" dependencies = [ "pyo3", ] diff --git a/rust-base32/Cargo.toml b/rust-base32/Cargo.toml index b8ee17a..b6409e4 100644 --- a/rust-base32/Cargo.toml +++ b/rust-base32/Cargo.toml @@ -1,6 +1,6 @@ [package] -name = "typeid_base32" -version = "0.3.5" +name = "typeid-base32" +version = "0.3.6" edition = "2021" [lib] diff --git a/rust-base32/pyproject.toml b/rust-base32/pyproject.toml new file mode 100644 index 0000000..2404d8e --- /dev/null +++ b/rust-base32/pyproject.toml @@ -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"]