Skip to content

Feat/remove manual pyversioning#71

Draft
tmi wants to merge 3 commits intomainfrom
feat/removeManualPyversioning
Draft

Feat/remove manual pyversioning#71
tmi wants to merge 3 commits intomainfrom
feat/removeManualPyversioning

Conversation

@tmi
Copy link
Copy Markdown
Collaborator

@tmi tmi commented Apr 22, 2026

Makes the VERSION management easier for python:

  • all python packages dont maintain their own VERSION anymore, but instead take from envvar
  • Makefile now handles this envvar when invoking python-build

Consequences:

  • you can't just install the package, you need to export version yourself or use the Makefile (we can make the Makefile more granular, or have per-wheel Makefile, etc)
  • tenosgram-anemoi and jupyter-examples are now covered by the default python-build test

Docs Preview
https://sites.ecmwf.int/docs/tensogram/pull-requests/PR-71

tmi and others added 3 commits April 22, 2026 12:02
Remove hardcoded version strings from all Python pyproject.toml files.
Version is now read at build time from the single source of truth:

- python/bindings (maturin): dynamic = ["version"], maturin reads from Cargo.toml
- python/tensogram-{xarray,zarr,anemoi} (hatchling): [tool.hatch.version] env source
- examples/jupyter (hatchling): same env source; add minimal package dir for hatchling

Makefile python-build:
- Pass VERSION=$(cat VERSION) to all uv pip install steps
- Add install steps for tensogram-anemoi and examples/jupyter (previously missing)
- Switch maturin invocation from 'uv run --with maturin maturin' to 'uvx maturin'
  to avoid uv's cross-Python lockfile resolution failing on the zarr/Python<3.11
  incompatibility in the optional extras

AGENTS.md: remove pyproject.toml from the release checklist — Python packages
no longer require a manual version bump.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Hatchling's env source has no built-in fallback. Switch all four hatchling
packages to source = "code" pointing at a small _version.py that reads the
VERSION env var with a safe default:

    __version__ = os.environ.get("VERSION", "0.0.0.dev1")

This means plain 'pip install -e .' works out of the box for developers who
haven't set VERSION, while the Makefile's 'VERSION=$(cat VERSION) uv pip
install' still stamps the correct release version.

Packages updated: tensogram-xarray, tensogram-zarr, tensogram-anemoi,
tensogram-jupyter-examples.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
@tmi tmi force-pushed the feat/removeManualPyversioning branch from 9cc3b08 to 10f393f Compare April 22, 2026 11:43
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.

1 participant