Skip to content

chore: replace hatch environments with uv + ci scripts#4096

Open
maxrjones wants to merge 7 commits into
zarr-developers:mainfrom
maxrjones:chore/replace-hatch-with-uv
Open

chore: replace hatch environments with uv + ci scripts#4096
maxrjones wants to merge 7 commits into
zarr-developers:mainfrom
maxrjones:chore/replace-hatch-with-uv

Conversation

@maxrjones

@maxrjones maxrjones commented Jun 24, 2026

Copy link
Copy Markdown
Member

This PR switches to using uv + just + hatchling rather than uv + hatch + hatchling.

For context, I think it's sub-optimal to have environments managed by both hatch (for CI and in contributing guide) and uv (for typing). This PR shows how we could use only uv via a small set of bash scripts that make up for the missing task runner and environment names features in uv relative to hatch. The benefit is that all of our CI and developer workflows would be based on the exact same lock files for improved reproducibility.

I tried hatch's new lockfile support first, but it's platform specific so it doesn't help us much given we want cross-platform consistency.

I don't feel strongly about this PR, so totally fine being told that we should stick with the status quo.

TODO:

  • Add unit tests and/or doctests in docstrings
  • Add docstrings and API docs for any new/modified user-facing classes and functions
  • New/modified features documented in docs/user-guide/*.md
  • Changes documented as a new file in changes/
  • GitHub Actions have all passed
  • Test coverage is 100% (Codecov passes)

@d-v-b

d-v-b commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

i can understand how some folks might not like the churn but I'm +1 on this. we can always go back to hatch if we don't like plain uv.

@d-v-b

d-v-b commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

@maxrjones did you consider putting some of these scripts into a runner like a justfile?

@maxrjones

Copy link
Copy Markdown
Member Author

@maxrjones did you consider putting some of these scripts into a runner like a justfile?

I considered nox/tox, but decided those were overkill after a chat with @chuckwondo. Just might be a better fit

@d-v-b

d-v-b commented Jun 24, 2026

Copy link
Copy Markdown
Contributor

i mention just or something similar because I do think there's real value in a one-stop place for the verbs we need as developers. hatch never really delivered on this, but I think the goal is good. See https://github.com/earth-mover/icechunk/blob/main/Justfile

Comment thread pyproject.toml
'packaging>=22.0',
'numpy>=2',
'numcodecs>=0.14',
'numcodecs>=0.14.1',

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Zarr-Python was actually not compatible with numcodecs 0.14.0; the lowest supported version is 0.14.1 in reality due to the need for the soft dependency fixes in https://github.com/zarr-developers/numcodecs/releases/tag/v0.14.1.

@maxrjones maxrjones self-assigned this Jun 25, 2026
@ilan-gold

Copy link
Copy Markdown
Contributor

At first glance I'm opposed to it because now we're maintaining a script. There's also now a cool vscode plugin for hatch environments: https://github.com/pypa/hatch-code

I will set this to unread and look later though

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants