Development#

See CLAUDE.md in the repository root for the full coding conventions.

Test levels#

Level

Command

What runs

quick

uv run pytest

Unit tests with no network, in under 30 s

install

uv run pytest --level=install

Adds settings-file layering, every module imports cleanly, CLI, wheel build and install, docs build

full

uv run pytest --level=full

Adds every remote source contacted at the first and last date of its time range

Tests in tests/install and tests/full are marked automatically. Mark a long test in any directory with @pytest.mark.slow; slow tests run at the install level and above.

Docs#

uv run --group docs sphinx-build -b html docs docs/_build/html

NumPy-style docstrings are rendered by napoleon. A new public function needs no extra step: the API pages are generated by autosummary.

Releasing#

The version lives only in pyproject.toml; seagrid.__version__ and the docs read it from the installed package. Change it with uv version, which also updates uv.lock:

uv version --bump patch      # 2.5.1 -> 2.5.2 (or minor, major)
uv version --bump minor --bump dev   # 2.5.1 -> 2.6.0.dev1, between releases
uv version --bump stable     # 2.6.0.dev1 -> 2.6.0
uv version 2.6.0             # an exact version

Add --dry-run to see the result without changing anything.

To release:

  1. Bump the version with uv version (above).

  2. Rename the ## X.Y.Z (unreleased) heading in docs/changelog.md to ## X.Y.Z (YYYY-MM-DD).

  3. Run the tests: uv run pytest --level=install (and ruff, mypy).

  4. Commit and tag:

    git commit -am "Release X.Y.Z"
    git tag -a vX.Y.Z -m "seagrid X.Y.Z"
    
  5. Build, check and upload (the token is read from UV_PUBLISH_TOKEN):

    rm -rf dist && uv build
    uvx twine check dist/*
    uv publish dist/seagrid-X.Y.Z*
    

    PyPI never accepts the same version twice; a fix needs a new version.

  6. Push the branches and the tag (see CLAUDE.md, Releasing, for GitHub).