diff --git a/.github/workflows/pr.yml b/.github/workflows/pr.yml index de1946d..0ac935a 100644 --- a/.github/workflows/pr.yml +++ b/.github/workflows/pr.yml @@ -21,7 +21,6 @@ jobs: - name: Sync dependencies (locked) run: | uv sync --locked --all-groups - uv sync --extra rust - name: Run linters run: | @@ -44,7 +43,6 @@ jobs: - name: Sync dependencies (locked) run: | uv sync --locked --all-groups - uv sync --extra rust - name: Run tests run: | diff --git a/.github/workflows/publish.yml b/.github/workflows/publish.yml index 5cfd3e1..63a9b9d 100644 --- a/.github/workflows/publish.yml +++ b/.github/workflows/publish.yml @@ -12,36 +12,15 @@ jobs: test: uses: ./.github/workflows/test.yml - publish-docs: - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-python@v5 - with: - python-version: "3.11" - - - name: Install uv - uses: astral-sh/setup-uv@v3 - - - name: Sync dependencies (locked) - run: | - uv sync --locked --all-groups - - - name: Deploy to Pages - run: uv run mkdocs gh-deploy --force - build-wheels: name: Build wheels (${{ matrix.os }}) runs-on: ${{ matrix.os }} - needs: - - test - - publish-docs + needs: test strategy: fail-fast: false matrix: os: [ubuntu-latest, macos-latest, windows-latest] - python-version: ["3.11"] + python-version: ["3.10", "3.11", "3.12", "3.13", "3.14"] steps: - name: Checkout @@ -76,8 +55,7 @@ jobs: build-sdist: runs-on: ubuntu-latest - needs: - - test + needs: build-wheels steps: - name: Checkout uses: actions/checkout@v4 @@ -106,11 +84,9 @@ jobs: name: sdist path: dist/*.tar.gz - publish: + publish-package: runs-on: ubuntu-latest - needs: - - build-wheels - - build-sdist + needs: build-sdist permissions: contents: read id-token: write @@ -131,3 +107,23 @@ jobs: uses: pypa/gh-action-pypi-publish@release/v1 with: packages-dir: out + + publish-docs: + runs-on: ubuntu-latest + needs: publish-package + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-python@v5 + with: + python-version: "3.11" + + - name: Install uv + uses: astral-sh/setup-uv@v3 + + - name: Sync dependencies (locked) + run: | + uv sync --locked --all-groups + + - name: Deploy to Pages + run: uv run mkdocs gh-deploy --force \ No newline at end of file diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 30cc73f..ed8cc43 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -37,7 +37,6 @@ jobs: - name: Sync dependencies (locked) run: | uv sync --locked --all-groups - uv sync --extra rust - name: Run tests run: | diff --git a/pyproject.toml b/pyproject.toml index 2d1a347..18e0f1e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,6 +1,6 @@ [project] name = "typeid-python" -version = "0.3.5" +version = "0.3.6" description = "Python implementation of TypeIDs: type-safe, K-sortable, and globally unique identifiers inspired by Stripe IDs" authors = [{ name = "Murad Akhundov", email = "akhundov1murad@gmail.com" }] requires-python = ">=3.10,<4" @@ -27,9 +27,9 @@ dependencies = ["uuid6>=2024.7.10,<2026.0.0"] [project.optional-dependencies] cli = ["click"] yaml = ["PyYAML"] -rust = ["uuid-utils>=0.12.0"] +rust = ["uuid-utils>=0.12.0", "typeid_base32>=0.3.5,<0.4.0"] -[project.urls] +[project.urls] Homepage = "https://github.com/akhundMurad/typeid-python" Repository = "https://github.com/akhundMurad/typeid-python" "Bug Tracker" = "https://github.com/akhundMurad/typeid-python/issues" diff --git a/rust-base32/Cargo.toml b/rust-base32/Cargo.toml index d7220cf..b8ee17a 100644 --- a/rust-base32/Cargo.toml +++ b/rust-base32/Cargo.toml @@ -9,4 +9,3 @@ crate-type = ["cdylib"] [dependencies] pyo3 = { version = "0.27.2", features = ["extension-module"] } - diff --git a/tests/test_uuid_backend.py b/tests/test_uuid_backend.py index c24f814..713b633 100644 --- a/tests/test_uuid_backend.py +++ b/tests/test_uuid_backend.py @@ -11,6 +11,11 @@ ], ) def test_backend_forced(monkeypatch, value, expected): + try: + import uuid_utils # noqa: F401 + except Exception: + pytest.skip("Rust extension uuid_utils not installed in this environment") + monkeypatch.setenv("TYPEID_UUID_BACKEND", value) backend = get_uuid_backend() assert backend.name == expected diff --git a/uv.lock b/uv.lock index 305b457..46eba93 100644 --- a/uv.lock +++ b/uv.lock @@ -1298,8 +1298,17 @@ wheels = [ ] [[package]] -name = "typeid-python" +name = "typeid-base32" version = "0.3.5" +source = { registry = "https://pypi.org/simple" } +wheels = [ + { url = "https://files.pythonhosted.org/packages/ac/dd/1dcc54960bb9a014dfcb646946e35ebf777e9b08b9da8ff8aca986a0ea1a/typeid_base32-0.3.5-cp311-cp311-macosx_11_0_arm64.whl", hash = "sha256:b4087efae9a82edec788aef1b31ee64bfd1a94d8d5a6b5da077e710d3c014ad6", size = 208486, upload-time = "2026-01-03T15:56:22.982Z" }, + { url = "https://files.pythonhosted.org/packages/02/8e/52c9468e49ac9db141ca85e5a31240fa63259e0e9982d38473ac28c40453/typeid_base32-0.3.5-cp311-cp311-win_amd64.whl", hash = "sha256:e7ef97f472d7cf166130d5f56711331fb6367283326d03750660fdf239493234", size = 99966, upload-time = "2026-01-03T15:56:24.363Z" }, +] + +[[package]] +name = "typeid-python" +version = "0.3.6" source = { editable = "." } dependencies = [ { name = "uuid6" }, @@ -1310,6 +1319,7 @@ cli = [ { name = "click" }, ] rust = [ + { name = "typeid-base32" }, { name = "uuid-utils" }, ] yaml = [ @@ -1340,6 +1350,7 @@ dev = [ requires-dist = [ { name = "click", marker = "extra == 'cli'" }, { name = "pyyaml", marker = "extra == 'yaml'" }, + { name = "typeid-base32", marker = "extra == 'rust'", specifier = ">=0.3.5,<0.4.0" }, { name = "uuid-utils", marker = "extra == 'rust'", specifier = ">=0.12.0" }, { name = "uuid6", specifier = ">=2024.7.10,<2026.0.0" }, ]