Skip to content

refactor: bring in types from zarr-metadata #129

refactor: bring in types from zarr-metadata

refactor: bring in types from zarr-metadata #129

Workflow file for this run

name: zarr-metadata
# The justfile's `uv run` recipes resolve against the repo-root uv workspace,
# whose `requires-python = ">=3.12"` blocks the 3.11 floor tested here, so
# most jobs install into standalone venvs instead of delegating to
# packages/zarr-metadata/justfile (only workspace-independent recipes like
# `just lint` are shared). Keep pins in sync with the justfile.
on:
push:
branches: [main]
paths:
- 'packages/zarr-metadata/**'
- '.github/workflows/zarr-metadata.yml'
pull_request:
paths:
- 'packages/zarr-metadata/**'
- '.github/workflows/zarr-metadata.yml'
workflow_dispatch:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
# zarr-metadata CI installs zarr-metadata standalone, not as a uv
# workspace member. The workspace at the repo root forces uv to honor
# `requires-python = ">=3.12"` from zarr-python's pyproject.toml, which
# blocks Python 3.11 even though zarr-metadata itself supports 3.11+.
# Using `uv venv` + `uv pip install` from a tmp directory bypasses
# workspace resolution and tests zarr-metadata the way downstream users
# actually install it: as a standalone package from PyPI.
test:
name: pytest py=${{ matrix.python-version }}
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: packages/zarr-metadata
strategy:
fail-fast: false
matrix:
python-version: ['3.11', '3.12', '3.13', '3.14']
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
- name: Create standalone Python ${{ matrix.python-version }} venv
# Place the venv outside the workspace tree so uv doesn't try
# to resolve workspace-wide requirements.
run: uv venv "$RUNNER_TEMP/zm-venv" --python ${{ matrix.python-version }} --seed
- name: Install zarr-metadata and test deps
run: |
uv pip install \
--python "$RUNNER_TEMP/zm-venv/bin/python" \
--group pyproject.toml:test \
.
- name: Run pytest
run: '"$RUNNER_TEMP/zm-venv/bin/python" -m pytest tests'
ruff:
name: ruff
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: packages/zarr-metadata
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
- name: Install just
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4
- name: Run ruff
run: just lint
pyright:
name: pyright
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: packages/zarr-metadata
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
- name: Create standalone Python 3.11 venv
run: uv venv "$RUNNER_TEMP/zm-venv" --python 3.11 --seed
- name: Install zarr-metadata and test deps
run: |
uv pip install \
--python "$RUNNER_TEMP/zm-venv/bin/python" \
--group pyproject.toml:test \
.
- name: Run pyright
# Pinned to the last pyright that types PEP 661 sentinels in class
# attributes correctly; 1.1.405+ regressed (microsoft/pyright#11115).
# Keep in sync with the pin in packages/zarr-metadata/justfile.
run: uvx --python "$RUNNER_TEMP/zm-venv/bin/python" pyright==1.1.404 src
docs:
name: docs
runs-on: ubuntu-latest
defaults:
run:
shell: bash
working-directory: packages/zarr-metadata
steps:
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
with:
persist-credentials: false
- name: Install uv
uses: astral-sh/setup-uv@11f9893b081a58869d3b5fccaea48c9e9e46f990 # v8.3.2
with:
enable-cache: true
- name: Create standalone Python 3.12 venv
run: uv venv "$RUNNER_TEMP/zm-venv" --python 3.12 --seed
- name: Install zarr-metadata and docs deps
run: |
uv pip install \
--python "$RUNNER_TEMP/zm-venv/bin/python" \
--group pyproject.toml:docs \
.
- name: Build docs
run: |
DISABLE_MKDOCS_2_WARNING=true "$RUNNER_TEMP/zm-venv/bin/python" \
-m mkdocs build --strict
zarr-metadata-complete:
name: zarr-metadata 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!