Let uv build the extension, so that dev commands need no `--no-project`
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 54/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- build-system, testing
Research direction
Read pyproject.toml, DEVELOP.md, and the pytest job in .github/workflows/test-python.yml; compare the current setup with the proposed uv settings. Check the stable ABI, free-threaded build, rebuild time, and async feature in this repository. Done when development commands work without --no-project or a separate maturin develop step, and the documented test workflow passes.
Written by the indexing model from the issue text.
Description
[!NOTE]
This issue was written by Claude (Claude Code), at @kylebarron's request.
Problem
Every development command takes --no-project, and the extension is built in a separate maturin develop step. DEVELOP.md explains why:
The
--no-projectis annoying, but our current setup makes it necessary. Without it,uvtries to build the Rust library in release mode, as a dependency of the project, before it gets touv syncoruv run.
Proposal
Let uv do that build, and configure it to build what maturin develop builds. Add this to pyproject.toml:
[tool.uv]
# `uv sync` and `uv run` build the extension themselves. These settings make
# that build match `maturin develop`: the dev profile, and the stable ABI so
# that PyO3 is not rebuilt for each new build environment.
config-settings = { build-args = "--profile=dev --features=abi3-py311" }
# Rebuild the extension when the Rust sources change.
cache-keys = [
{ file = "pyproject.toml" },
{ file = "Cargo.toml" },
{ file = "Cargo.lock" },
{ file = "src/**/*.rs" },
]
uv run pytest is then the whole loop. uv builds the extension before it runs the command, and builds it again when a Rust source changes. There is no maturin develop step and no flag.
What was measured
This was measured in another PyO3 and maturin project of ours, with a very small binding crate, on uv 0.13.1 and maturin 1.16. It has not been tried in zarrista. Each row is "edit a Rust source, then run the tests", three times.
| Setup | Time per edit |
|---|---|
maturin develop --uv, then pytest, both with --no-project |
0.64 s |
| uv builds, dev profile only | 3.2 s |
| uv builds, dev profile and the stable ABI | 0.56 s |
| Nothing changed, either setup | 0.22 s |
The middle row is why abi3-py311 is in build-args. uv builds in a fresh environment each time, and without the stable ABI Cargo rebuilds pyo3-ffi and pyo3 for each one. zarrista has several more crates that depend on PyO3, so the cost there is probably higher than 3 s.
Where the settings apply, from the same test:
| Who builds | Result |
|---|---|
uv sync or uv run in the project |
Dev build with the stable ABI |
| A project that depends on the package by path | A normal release build; the settings do not leak |
uv build in the project |
Dev build. Release wheels must come from maturin, as python-wheels.yml already does. |
What would change here
pyproject.toml: the[tool.uv]table above.DEVELOP.md:uv run pytest,uv run ruff check, and so on, with no build step.- The
pytestjob intest-python.yml:uv sync, thenuv run pytest. Thematurin developstep goes away. - The
docstringsanddocsjobs keep--no-install-package zarristaand--no-project. They skip the build on purpose, because they only read the.pyistubs.
To check before adopting it
- Tests would run against a stable-ABI build. That matches the
abi3-py311wheel. The free-threadedcp314twheel is not a stable-ABI build, so a free-threaded development environment would need the feature turned off, and would pay the PyO3 rebuild on each edit. - How long a rebuild takes in zarrista, with and without the stable ABI.
- The async feature.
default = ["async"]stays on, sincebuild-argsonly adds a feature.
- Dominant language
- Python
- Stars
- 52
- Forks
- 3
- Avg merge
- 36m
- Merged PRs (30d)
- 5
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from developmentseed/zarrista
-
Difficulty 5/5 Over a week Newbie friendliness 35/100
developmentseed/zarrista#211 · 1 comment ·
-
Bump to arrow 60Open
Difficulty 2/5 1-3 hours Newbie friendliness 55/100
developmentseed/zarrista#203 ·
-
Read and write icechunk sessions through the zarr-python Store instead of linking the icechunk crateOpen
Difficulty 5/5 Over a week Newbie friendliness 35/100
developmentseed/zarrista#196 ·
-
pyemscripten wheel is unimportable: the Python layer imports async-only classes unconditionallyOpen
Difficulty 3/5 1-2 days Newbie friendliness 57/100
developmentseed/zarrista#189 · 3 comments ·
-
Difficulty 3/5 1-2 days Newbie friendliness 65/100
developmentseed/zarrista#187 · 1 comment ·
All issues in developmentseed/zarrista
Similar issues
-
Task select patterns with uppercase letters never matchPossibly taken @manobhisriram claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
app: scripts status: backlog type: housekeeping
Difficulty 1/5 1-3 hours Newbie friendliness 88/100
netbox-community/netbox-scripts#239 ·
Maintainers usually reply within 1 day
-
Lambda deploys fail once the bundle grows by about 254 KBPossibly taken A pull request linked to this issue is open or already merged. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
developmentseed/titiler-cmr#341 ·
Maintainers usually reply within 1 day
-
Card tables add "..." to every value in a DataFrame column when any value is longer than 30 charactersPossibly taken @omkarbandikatte claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day