Maintenance & Distribution Guide¶
How the project is maintained, tested, and released. Every publish step runs in GitHub Actions; nothing is uploaded from a maintainer machine.
Local Development Setup¶
To install all dependencies required for development, testing, and documentation:
Running Quality Checks¶
Before submitting a PR, ensure all checks pass:
# Linting and formatting
ruff check .
ruff format --check .
# Type checking
mypy src/
mypy tests/
# Testing
pytest tests/
These are the same gates CI runs. CI additionally enforces branch coverage and the packaging/release-contract suites.
Version Surfaces¶
The version is written in six places, all of which must agree. Drift fails
scripts/check_version_lockstep.py in CI and again in the release workflow.
pyproject.toml—[project] version(the authoritative value)src/cds/_version.py—__version__(re-exported ascds.__version__)package.json—versionof the npm launchercodemeta.json—versionof the CodeMeta recordCITATION.cff— top-level andpreferred-citationversion fieldsCHANGELOG.md— a## [vX.Y.Z]heading
scripts/check_version_discipline.py additionally requires the new version to be
greater than the previous release tag.
Release (automatic)¶
- Open a PR that bumps every version surface above, and merge it to
main. - The
CIworkflow (.github/workflows/tests.yml) runs the full matrix. Main runs are never cancelled, because the release workflow consumes their result. - When
CIcompletes successfully for a push tomainwhose commit changedsrc/cds/_version.py, theReleaseworkflow (.github/workflows/release.yml) starts viaworkflow_run, binds itself to the exact CI-tested commit, and: - resolves the previous release tag and re-runs the version-discipline and lockstep gates against it;
- builds the sdist and wheel with the hash-locked toolchain
(
requirements-build.lock,python -m build --no-isolation); - validates metadata (
twine check --strict), artifact contents (scripts/check_distribution_contents.py), and the installed CLI (scripts/verify_cli_install.py); - attests build provenance with
actions/attest-build-provenance; - publishes to PyPI through Trusted Publishing (OIDC,
pypienvironment) — no API token secret is used or needed; - creates the annotated
vX.Y.Ztag only after PyPI accepted the upload; - creates a GitHub Release without PyPI wheel/sdist assets (the artifacts
live on PyPI); the signing workflow may attach one source archive plus its
.sigstorebundle; - verifies the result with
scripts/verify_release_integrity.py.
A push to main that does not touch src/cds/_version.py does not release —
unless the version in pyproject.toml is not yet on PyPI. That self-healing
path releases the tree version from the CI-tested commit, so a version bump
whose first main CI run failed cannot stay stranded behind a later fix. The
publish job re-checks PyPI before uploading, so it cannot duplicate a release.
One-time PyPI setup¶
The pypi environment is protected and registered as a Trusted Publisher on
PyPI: owner Furox-Art, repository scientific-computing-system, workflow
release.yml, environment pypi. There is no PYPI_API_TOKEN secret.
Recovery¶
- If PyPI accepted the upload but the tag or GitHub Release step failed, dispatch
Releasemanually withversion(optionallyrelease_sha). That recovery path never builds or uploads, and refuses versions that are not already on PyPI. - Re-running a failed
Releaserun is safe: when the exact wheel and sdist already exist on PyPI, the workflow switches to recovery mode and skips the upload. - Do not push release tags by hand. Release tags are immutable and created by the workflow after a successful publish.
npm Launcher¶
.github/workflows/npm-publish.yml is the sole npm authority. It runs when the
Release workflow completes and proceeds only when the PyPI publish job
succeeded. A manual dispatch from main reads the version at the dispatch commit
and checks out its release tag. A v* tag push must match package.json. Every
path verifies the version on PyPI and checks the source against the published
GitHub release tag. The default OIDC publish includes a provenance attestation.
Dispatch with use_token_fallback=true only while
the npm trusted publisher is unavailable, which publishes without provenance.
The trusted publisher is registered: npmjs.com → scientific-computing-system →
Settings → Trusted Publisher (owner Furox-Art, workflow npm-publish.yml,
environment npm, with npm publish allowed).
Documentation Deployment¶
Documentation deploys automatically. The deploy-docs job in
.github/workflows/tests.yml runs after the aggregate CI gate succeeds on a
push to main, builds with mkdocs build --strict, and then runs
mkdocs gh-deploy. No maintainer machine deploys the docs.
Local Release Preflight¶
scripts/publish.py is a local preflight only: it verifies a clean tree on
main, runs the tests, builds, and confirms the built wheel matches the version
declared in pyproject.toml. It does not push tags, deploy docs, or upload
anything. Merge to main and let CI perform the release.