Skip to content

Commit 3fd36cd

Browse files
committed
docs(zarr-indexing): standalone documentation site; add package justfile
Mirror the treatment zarr-metadata received in zarr-developers#4208/zarr-developers#4210 onto zarr-indexing: a self-contained mkdocs site under the package (own mkdocs.yml, landing page, ndsel wire-format guide, mkdocstrings page per module, and .readthedocs.yaml for a dedicated RTD project), so the package presents as a separate project with docs versioned by its own zarr_indexing-v* release tags rather than zarr-python's. The zarr-python site's API Reference nav links out to it, and each RTD project now skips PR builds that do not touch its half of the repo. The package gains a pinned docs dependency group, a docs build job in its CI workflow, and a justfile with package-scoped dev recipes. Two recipes deviate from the zarr-metadata original by design: - `test` runs against the workspace-root environment (`uv run --project ../.. --all-packages --group test`), because the chunk-resolution tests exercise this package against zarr's chunk grids and `zarr` is deliberately not a dependency of this package. - `typecheck` uses plain `pyright`, unpinned and on the default interpreter, mirroring this package's own CI invocation. The zarr-metadata pin exists for a PEP 661 sentinel regression that zarr-indexing's sources do not hit. composition.py gains the module docstring the other modules already have, since mkdocstrings renders it as the page introduction. Assisted-by: ClaudeCode:claude-fable-5
1 parent fb8a2a7 commit 3fd36cd

24 files changed

Lines changed: 697 additions & 10 deletions

.github/workflows/zarr-indexing.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,9 +87,30 @@ jobs:
8787
- name: Run pyright
8888
run: uv run --group test --with pyright pyright src
8989

90+
docs:
91+
name: docs
92+
runs-on: ubuntu-latest
93+
defaults:
94+
run:
95+
shell: bash
96+
working-directory: packages/zarr-indexing
97+
steps:
98+
- uses: actions/checkout@9c091bb21b7c1c1d1991bb908d89e4e9dddfe3e0 # v7.0.0
99+
with:
100+
persist-credentials: false
101+
- name: Install uv
102+
uses: astral-sh/setup-uv@fac544c07dec837d0ccb6301d7b5580bf5edae39 # v8.2.0
103+
with:
104+
enable-cache: true
105+
- name: Install just
106+
uses: extractions/setup-just@53165ef7e734c5c07cb06b3c8e7b647c5aa16db3 # v4
107+
- name: Build docs
108+
# The strict mkdocs build lives in packages/zarr-indexing/justfile.
109+
run: just docs-check
110+
90111
zarr-indexing-complete:
91112
name: zarr-indexing complete
92-
needs: [test, ruff, pyright]
113+
needs: [test, ruff, pyright, docs]
93114
if: always()
94115
runs-on: ubuntu-latest
95116
steps:

.readthedocs.yaml

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,15 +6,14 @@ build:
66
python: "3.12"
77
jobs:
88
post_checkout:
9-
# Cancel pull request builds whose changes are confined to the
10-
# zarr-metadata package, which has its own Read the Docs project. Exit
11-
# code 183 cancels the build and reports success to the Git provider.
12-
# Scoped to PR builds ("external" versions) because origin/main is only
13-
# a meaningful diff base there. Read the Docs strips shell quoting from
14-
# commands, so the exclude pathspec must use the quote-free :! form,
15-
# not ':(exclude)'.
9+
# Cancel pull request builds whose changes are confined to the packages
10+
# that have their own Read the Docs projects. Exit code 183 cancels the
11+
# build and reports success to the Git provider. Scoped to PR builds
12+
# ("external" versions) because origin/main is only a meaningful diff
13+
# base there. Read the Docs strips shell quoting from commands, so the
14+
# exclude pathspecs must use the quote-free :! form, not ':(exclude)'.
1615
- |
17-
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- :!packages/zarr-metadata;
16+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- :!packages/zarr-metadata :!packages/zarr-indexing;
1817
then
1918
exit 183;
2019
fi

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ nav:
9393
- '<code class="doc-symbol doc-symbol-toc doc-symbol-function"></code> <code>zarr.zeros</code>': api/zarr/functions/zeros.md
9494
- '<code class="doc-symbol doc-symbol-toc doc-symbol-function"></code> <code>zarr.zeros_like</code>': api/zarr/functions/zeros_like.md
9595
- 'zarr-metadata ↪': https://zarr-metadata.readthedocs.io/
96+
- 'zarr-indexing ↪': https://zarr-indexing.readthedocs.io/
9697
- release-notes.md
9798
- contributing.md
9899
hooks:
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Read the Docs configuration for the zarr-indexing docs site, separate from
2+
# the zarr-python site configured by the repo-root .readthedocs.yaml. The RTD
3+
# project for zarr-indexing must set its configuration-file path to
4+
# packages/zarr-indexing/.readthedocs.yaml.
5+
version: 2
6+
7+
build:
8+
os: ubuntu-22.04
9+
tools:
10+
python: "3.12"
11+
jobs:
12+
post_checkout:
13+
# Cancel pull request builds that do not touch this package. Exit code
14+
# 183 cancels the build and reports success to the Git provider. Scoped
15+
# to PR builds ("external" versions) because origin/main is only a
16+
# meaningful diff base there.
17+
- |
18+
if [ "$READTHEDOCS_VERSION_TYPE" = "external" ] && git diff --quiet origin/main -- packages/zarr-indexing;
19+
then
20+
exit 183;
21+
fi
22+
install:
23+
- pip install --upgrade pip
24+
- pip install ./packages/zarr-indexing --group packages/zarr-indexing/pyproject.toml:docs
25+
build:
26+
html:
27+
- mkdocs build --strict -f packages/zarr-indexing/mkdocs.yml --site-dir $READTHEDOCS_OUTPUT/html
28+
29+
mkdocs:
30+
configuration: packages/zarr-indexing/mkdocs.yml

packages/zarr-indexing/README.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,8 @@
22

33
Composable, lazy coordinate transforms for Zarr array indexing.
44

5+
Documentation: <https://zarr-indexing.readthedocs.io/>
6+
57
This package implements TensorStore-inspired index transforms. The core idea:
68
every indexing operation (slicing, fancy indexing, etc.) produces a coordinate
79
mapping from user space to storage space. These mappings compose lazily — no
@@ -25,6 +27,27 @@ repository and consumed by `zarr` to resolve array indexing operations.
2527
pip install zarr-indexing
2628
```
2729

30+
## Developing
31+
32+
Package-scoped development commands live in the [`justfile`](./justfile)
33+
(requires [just](https://github.com/casey/just)):
34+
35+
```
36+
just test # run the test suite (extra args go to pytest)
37+
just lint # ruff, same invocation as CI
38+
just typecheck # pyright, same invocation as CI
39+
just docs-check # strict build of the docs site
40+
just check # all of the above
41+
just docs-serve # serve the docs site locally
42+
```
43+
44+
Run them from this directory, or from anywhere in the repository as
45+
`just packages/zarr-indexing/<recipe>`.
46+
47+
The test recipe runs against the workspace-root environment, because the
48+
chunk-resolution tests exercise this package against `zarr`'s chunk grids and
49+
`zarr` is deliberately not a dependency of this package.
50+
2851
## License
2952

3053
MIT
12.4 KB
Loading
44.1 KB
Loading
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: chunk_resolution
3+
---
4+
5+
::: zarr_indexing.chunk_resolution
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: composition
3+
---
4+
5+
::: zarr_indexing.composition
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
title: domain
3+
---
4+
5+
::: zarr_indexing.domain

0 commit comments

Comments
 (0)