rustytree-xarray 0.1.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (38) hide show
  1. rustytree_xarray-0.1.0/.github/workflows/ci.yml +67 -0
  2. rustytree_xarray-0.1.0/.github/workflows/release.yml +137 -0
  3. rustytree_xarray-0.1.0/.gitignore +49 -0
  4. rustytree_xarray-0.1.0/CHANGELOG.md +497 -0
  5. rustytree_xarray-0.1.0/Cargo.lock +5094 -0
  6. rustytree_xarray-0.1.0/Cargo.toml +63 -0
  7. rustytree_xarray-0.1.0/LICENSE +201 -0
  8. rustytree_xarray-0.1.0/PKG-INFO +147 -0
  9. rustytree_xarray-0.1.0/README.md +117 -0
  10. rustytree_xarray-0.1.0/docs/architecture.md +283 -0
  11. rustytree_xarray-0.1.0/docs/contributing.md +70 -0
  12. rustytree_xarray-0.1.0/docs/release-process.md +93 -0
  13. rustytree_xarray-0.1.0/docs/usage.md +147 -0
  14. rustytree_xarray-0.1.0/notebooks/klot_demo.ipynb +4118 -0
  15. rustytree_xarray-0.1.0/pyproject.toml +67 -0
  16. rustytree_xarray-0.1.0/python/rustytree/__init__.py +11 -0
  17. rustytree_xarray-0.1.0/python/rustytree/_array.py +81 -0
  18. rustytree_xarray-0.1.0/python/rustytree/backend.py +490 -0
  19. rustytree_xarray-0.1.0/src/array.rs +300 -0
  20. rustytree_xarray-0.1.0/src/dtype_dispatch.rs +82 -0
  21. rustytree_xarray-0.1.0/src/error.rs +127 -0
  22. rustytree_xarray-0.1.0/src/glob.rs +217 -0
  23. rustytree_xarray-0.1.0/src/icechunk_store.rs +183 -0
  24. rustytree_xarray-0.1.0/src/lib.rs +304 -0
  25. rustytree_xarray-0.1.0/src/node.rs +71 -0
  26. rustytree_xarray-0.1.0/src/runtime.rs +52 -0
  27. rustytree_xarray-0.1.0/src/store.rs +142 -0
  28. rustytree_xarray-0.1.0/src/url.rs +145 -0
  29. rustytree_xarray-0.1.0/src/walk.rs +728 -0
  30. rustytree_xarray-0.1.0/tests/conftest.py +138 -0
  31. rustytree_xarray-0.1.0/tests/test_backend_entrypoint.py +587 -0
  32. rustytree_xarray-0.1.0/tests/test_chunks.py +98 -0
  33. rustytree_xarray-0.1.0/tests/test_eager_fetch.py +179 -0
  34. rustytree_xarray-0.1.0/tests/test_icechunk.py +177 -0
  35. rustytree_xarray-0.1.0/tests/test_lazy.py +174 -0
  36. rustytree_xarray-0.1.0/tests/test_phase1_scaffold.py +40 -0
  37. rustytree_xarray-0.1.0/tests/test_to_rust_source.py +94 -0
  38. rustytree_xarray-0.1.0/tests/test_walk.py +159 -0
@@ -0,0 +1,67 @@
1
+ name: CI
2
+
3
+ on:
4
+ push:
5
+ branches: [main]
6
+ pull_request:
7
+
8
+ # Cancel in-progress runs for the same branch when new commits land.
9
+ concurrency:
10
+ group: ci-${{ github.ref }}
11
+ cancel-in-progress: true
12
+
13
+ env:
14
+ CARGO_TERM_COLOR: always
15
+ RUSTFLAGS: -D warnings
16
+
17
+ jobs:
18
+ # Cargo gates run once on stable Rust. Cheap; no Python needed.
19
+ cargo:
20
+ name: cargo (fmt, clippy, test)
21
+ runs-on: ubuntu-latest
22
+ steps:
23
+ - uses: actions/checkout@v4
24
+ - uses: dtolnay/rust-toolchain@stable
25
+ with:
26
+ components: clippy, rustfmt
27
+ - uses: Swatinem/rust-cache@v2
28
+ - run: cargo fmt --check
29
+ - run: cargo clippy --all-targets --all-features --locked -- -D warnings
30
+ - run: cargo test --locked
31
+
32
+ # Python integration: build the cdylib via maturin and run pytest against
33
+ # the supported interpreter range. Each matrix cell rebuilds the extension
34
+ # because PyO3 cdylibs are interpreter-specific.
35
+ python:
36
+ name: pytest (Python ${{ matrix.python-version }})
37
+ needs: cargo
38
+ runs-on: ubuntu-latest
39
+ strategy:
40
+ fail-fast: false
41
+ matrix:
42
+ python-version: ["3.12"]
43
+ steps:
44
+ - uses: actions/checkout@v4
45
+ - uses: dtolnay/rust-toolchain@stable
46
+ - uses: Swatinem/rust-cache@v2
47
+ with:
48
+ # Keyed by Python version so each matrix cell gets its own cache.
49
+ key: py-${{ matrix.python-version }}
50
+ - uses: actions/setup-python@v5
51
+ with:
52
+ python-version: ${{ matrix.python-version }}
53
+ - uses: astral-sh/setup-uv@v4
54
+ - name: Set up venv and install maturin
55
+ run: |
56
+ uv venv --python "${{ matrix.python-version }}"
57
+ uv pip install --python .venv/bin/python maturin
58
+ - name: Install dev extras
59
+ # Install the [dev] extras directly rather than `pip install -e ".[dev]"`,
60
+ # which would re-trigger a full cdylib rebuild on top of maturin develop
61
+ # below (we'd build the wheel twice — saves ~80s per matrix cell).
62
+ # Keep this list in sync with the `dev` extra in pyproject.toml.
63
+ run: uv pip install --python .venv/bin/python pytest pytest-cov 'zarr>=3.0' 'icechunk>=2.0' ruff
64
+ - name: Build extension (maturin develop)
65
+ run: .venv/bin/maturin develop
66
+ - name: pytest
67
+ run: .venv/bin/pytest tests/ -v
@@ -0,0 +1,137 @@
1
+ name: Release
2
+
3
+ # Tag-driven: pushing a `vX.Y.Z` tag builds wheels + sdist and attaches
4
+ # them to a GitHub Release with auto-generated notes. PyPI publishing
5
+ # is gated behind a manual flip below — switch on once trusted
6
+ # publishing is configured for the project on PyPI.
7
+ #
8
+ # `workflow_dispatch` lets us dry-run the matrix without cutting a
9
+ # real release (e.g. on a release-prep branch) — the artifacts are
10
+ # uploaded but the `release` job is skipped because the ref isn't a
11
+ # tag.
12
+
13
+ on:
14
+ push:
15
+ tags: ["v*"]
16
+ workflow_dispatch:
17
+
18
+ permissions:
19
+ contents: write # gh release create
20
+ id-token: write # PyPI trusted publishing (when enabled)
21
+
22
+ env:
23
+ CARGO_TERM_COLOR: always
24
+ RUSTFLAGS: -D warnings
25
+
26
+ jobs:
27
+ build-wheels:
28
+ name: wheel ${{ matrix.platform.target }} py${{ matrix.python-version }}
29
+ strategy:
30
+ fail-fast: false
31
+ matrix:
32
+ platform:
33
+ # manylinux x86_64 — auto picks the most compatible PEP 600
34
+ # tag the toolchain supports (manylinux_2_28 today).
35
+ - { os: ubuntu-latest, target: x86_64-unknown-linux-gnu, manylinux: auto }
36
+ # manylinux aarch64 — Graviton, ARM cloud, Raspberry Pi.
37
+ # Native arm runner (`ubuntu-24.04-arm`, free for public
38
+ # repos): no QEMU emulation, no cross-compile toolchain
39
+ # quirks. Tried QEMU cross-compile first; `ring`'s ARM
40
+ # assembly bails because the manylinux cross-gcc doesn't
41
+ # define `__ARM_ARCH`. Native build sidesteps that and is
42
+ # ~3× faster too.
43
+ - { os: ubuntu-24.04-arm, target: aarch64-unknown-linux-gnu, manylinux: auto }
44
+ # Apple Silicon. The macos-14 runner is arm64-native, so the
45
+ # default target works without cross-compile.
46
+ - { os: macos-14, target: aarch64-apple-darwin, manylinux: auto }
47
+ python-version: ["3.12", "3.13"]
48
+ runs-on: ${{ matrix.platform.os }}
49
+ steps:
50
+ - uses: actions/checkout@v4
51
+ - uses: actions/setup-python@v5
52
+ with:
53
+ python-version: ${{ matrix.python-version }}
54
+ - uses: dtolnay/rust-toolchain@stable
55
+ # PyO3/maturin-action handles `--release`, manylinux container
56
+ # provisioning, and Python interpreter detection. We pass `-i
57
+ # python${PY}` so the wheel is built for exactly the matrix's
58
+ # interpreter rather than whatever happens to be on PATH.
59
+ - uses: PyO3/maturin-action@v1
60
+ with:
61
+ target: ${{ matrix.platform.target }}
62
+ manylinux: ${{ matrix.platform.manylinux }}
63
+ args: --release --strip --out dist -i python${{ matrix.python-version }}
64
+ - uses: actions/upload-artifact@v4
65
+ with:
66
+ name: wheel-${{ matrix.platform.target }}-py${{ matrix.python-version }}
67
+ path: dist/*.whl
68
+ if-no-files-found: error
69
+
70
+ build-sdist:
71
+ name: sdist
72
+ runs-on: ubuntu-latest
73
+ steps:
74
+ - uses: actions/checkout@v4
75
+ - uses: PyO3/maturin-action@v1
76
+ with:
77
+ command: sdist
78
+ args: --out dist
79
+ - uses: actions/upload-artifact@v4
80
+ with:
81
+ name: sdist
82
+ path: dist/*.tar.gz
83
+ if-no-files-found: error
84
+
85
+ # Tag-only: assemble all wheels + sdist into a GitHub Release. Skipped
86
+ # on workflow_dispatch (no tag) so a dry-run from a branch builds the
87
+ # matrix without cutting a release.
88
+ release:
89
+ name: GitHub release
90
+ needs: [build-wheels, build-sdist]
91
+ runs-on: ubuntu-latest
92
+ if: startsWith(github.ref, 'refs/tags/v')
93
+ # Two rapid tag pushes shouldn't race: serialize per-tag, but
94
+ # don't cancel an in-flight release run (it's already uploaded
95
+ # most of its artifacts).
96
+ concurrency:
97
+ group: release-${{ github.ref }}
98
+ cancel-in-progress: false
99
+ steps:
100
+ - uses: actions/checkout@v4
101
+ - uses: actions/download-artifact@v4
102
+ with:
103
+ path: dist
104
+ merge-multiple: true
105
+ - name: Create GitHub Release
106
+ env:
107
+ GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
108
+ run: |
109
+ gh release create "${GITHUB_REF#refs/tags/}" \
110
+ --generate-notes \
111
+ --verify-tag \
112
+ dist/*
113
+
114
+ # PyPI publish via OIDC trusted publishing. Requires:
115
+ # - PyPI Pending/Trusted Publisher configured for the project name
116
+ # `rustytree-xarray` (atmoscale org), pointing at this workflow
117
+ # file and the `pypi` environment.
118
+ # - GitHub repo Settings → Environments → `pypi` (with
119
+ # deployment-tag rule `v*.*.*` for safety).
120
+ # Both done; flipping the job on means every `vX.Y.Z` tag
121
+ # publishes both a GitHub Release and a PyPI release.
122
+ pypi-publish:
123
+ name: PyPI publish
124
+ needs: [build-wheels, build-sdist]
125
+ if: startsWith(github.ref, 'refs/tags/v')
126
+ runs-on: ubuntu-latest
127
+ environment: pypi
128
+ permissions:
129
+ id-token: write # mint short-lived OIDC tokens for trusted publishing
130
+ steps:
131
+ - uses: actions/download-artifact@v4
132
+ with:
133
+ path: dist
134
+ merge-multiple: true
135
+ - uses: pypa/gh-action-pypi-publish@release/v1
136
+ with:
137
+ packages-dir: dist
@@ -0,0 +1,49 @@
1
+ # Rust
2
+ target/
3
+ **/*.rs.bk
4
+
5
+ # Python
6
+ __pycache__/
7
+ *.py[cod]
8
+ *$py.class
9
+ *.egg
10
+ *.egg-info/
11
+ .pytest_cache/
12
+ .coverage
13
+ .coverage.*
14
+ htmlcov/
15
+ .tox/
16
+ .nox/
17
+ build/
18
+ dist/
19
+
20
+ # Maturin / extension artifacts inside the source tree
21
+ python/rustytree/*.so
22
+ python/rustytree/*.dylib
23
+ python/rustytree/*.pyd
24
+
25
+ # Virtual envs
26
+ .venv/
27
+ venv/
28
+ env/
29
+ .python-version
30
+
31
+ # Editors
32
+ .idea/
33
+ .vscode/
34
+ *.swp
35
+ *.swo
36
+
37
+ # OS
38
+ .DS_Store
39
+ Thumbs.db
40
+
41
+ # Local env
42
+ .env
43
+ .envrc
44
+
45
+ # Local planning notes (per-developer; not part of repo)
46
+ plans/
47
+
48
+ # Jupyter
49
+ .ipynb_checkpoints/