build: ground sub-package packaging in current uv/hatch/setuptools-scm guidance #239
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: zarr-indexing | |
| on: | |
| push: | |
| branches: [main] | |
| paths: | |
| - 'packages/zarr-indexing/**' | |
| - '.github/workflows/zarr-indexing.yml' | |
| # The docs config and header script shared by all package sites. | |
| - 'packages/mkdocs-base.yml' | |
| - 'packages/source-version.js' | |
| pull_request: | |
| paths: | |
| - 'packages/zarr-indexing/**' | |
| - '.github/workflows/zarr-indexing.yml' | |
| # The docs config and header script shared by all package sites. | |
| - 'packages/mkdocs-base.yml' | |
| - 'packages/source-version.js' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| test: | |
| name: pytest py=${{ matrix.python-version }} | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: packages/zarr-indexing | |
| strategy: | |
| fail-fast: false | |
| matrix: | |
| python-version: ['3.12', '3.13', '3.14'] | |
| # UV_PYTHON reaches every uv call inside the recipes, selecting the matrix | |
| # interpreter while keeping the justfile interpreter-agnostic for local use. | |
| env: | |
| UV_PYTHON: ${{ matrix.python-version }} | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 | |
| with: | |
| enable-cache: true | |
| - name: Install just | |
| uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1 | |
| with: | |
| repo: casey/just | |
| version: 1.58.0 | |
| - name: Set up Python ${{ matrix.python-version }} | |
| run: uv python install ${{ matrix.python-version }} | |
| # The suite imports nothing from `zarr`; it runs against the repo-root | |
| # environment, with this package as an editable overlay, to share the | |
| # parent project's pinned test toolchain. The recipes carry that | |
| # invocation; this step installs dependencies up front so their | |
| # install time is reported separately from the tests. | |
| - name: Sync test dependency group | |
| run: uv sync --group test | |
| - name: Check interpreter | |
| run: >- | |
| uv run --group test python -c | |
| "import sys; v = '%d.%d' % sys.version_info[:2]; | |
| assert v == '${{ matrix.python-version }}', v" | |
| - name: Run pytest | |
| # Suites and invocation live in packages/zarr-indexing/justfile. | |
| run: just test | |
| - name: Run pytest (tensorstore parity) | |
| run: just test-tensorstore | |
| ruff: | |
| name: ruff | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: packages/zarr-indexing | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 | |
| - name: Install just | |
| uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1 | |
| with: | |
| repo: casey/just | |
| version: 1.58.0 | |
| - name: Run ruff | |
| # The ruff version pin lives in packages/zarr-indexing/justfile. | |
| run: just lint | |
| pyright: | |
| name: pyright | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: packages/zarr-indexing | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 | |
| with: | |
| enable-cache: true | |
| - name: Set up Python | |
| run: uv python install 3.12 | |
| - name: Sync test dependency group | |
| run: uv sync --group test --python 3.12 | |
| - name: Install just | |
| uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1 | |
| with: | |
| repo: casey/just | |
| version: 1.58.0 | |
| - name: Run pyright | |
| # The pyright invocation lives in packages/zarr-indexing/justfile. | |
| run: just typecheck | |
| docs: | |
| name: docs | |
| runs-on: ubuntu-latest | |
| defaults: | |
| run: | |
| shell: bash | |
| working-directory: packages/zarr-indexing | |
| steps: | |
| - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 | |
| with: | |
| persist-credentials: false | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@bec219d24cd3e171d82865faccec33120bb574f4 # v10.1.0 | |
| with: | |
| enable-cache: true | |
| - name: Install just | |
| uses: extractions/setup-crate@7577c1bdf2d95e6d65d532788f35ed79d4b1dda2 # v2.0.1 | |
| with: | |
| repo: casey/just | |
| version: 1.58.0 | |
| - name: Build docs | |
| # The strict mkdocs build lives in packages/zarr-indexing/justfile. | |
| run: just docs-check | |
| zarr-indexing-complete: | |
| name: zarr-indexing complete | |
| needs: [test, ruff, pyright, docs] | |
| if: always() | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check failure | |
| if: | | |
| contains(needs.*.result, 'failure') || | |
| contains(needs.*.result, 'cancelled') | |
| run: exit 1 | |
| - name: Success | |
| run: echo Success! |