Release¶
Policy¶
Releases are a manual, protected step. No publishing credentials are
configured in CI, and nothing auto-publishes except when a v* tag is
pushed. The release.yml workflow is triggered manually (or by a tag push)
and:
- builds the sdist + the full abi3 wheel matrix (cibuildwheel) + a
pyodide (WebAssembly/emscripten) wheel (
cp313-emscripten_*_wasm32), - verifies artifact integrity (SHA-256) and artifact count,
- creates a GitHub Release with the artifacts (draft),
- publishes the artifacts to PyPI via trusted publishing (OIDC) as
py-attributedict— no tokens or secrets are stored in the repository.
Versioning (dynamic)¶
The version is derived from the git tag by setuptools-scm
(dynamic = ["version"] in pyproject.toml, the setuptools equivalent of
hatch-vcs used by sibling projects). Tag v0.1.0 → package version
0.1.0; v0.2.0rc1 → 0.2.0rc1. Without any tag, the build falls back to
0.1.0.dev0. Do not edit a version = field in pyproject.toml — there
isn't one; bump by tagging.
PyPI trusted publishing setup (one-time)¶
- Register the
py-attributedictproject on PyPI (the import name staysattributedict; the plainattributedictandattrdictnames are taken on PyPI by other authors). - On PyPI → "Your account" → "Publishing", add a publishing source:
- Platform: GitHub
- Owner:
OWNER - Repository:
attributedict - Workflow:
release.yml - Environment:
release - That's it — the
publishjob inrelease.ymlauthenticates via OIDC with no stored credentials.
Process¶
- Update
CHANGELOG.md. - Build locally and verify:
python -m build
# smoke-test the wheel in a clean venv
- Run the full validation:
nox -s tests lint typecheck coverage. - Create a Git tag (
vX.Y.Z) and push it — this also triggersrelease.ymlonpush: tags: ['v*']; or trigger it manually and pass the tag. - The workflow:
- builds sdist + abi3 wheels for every platform/arch (Linux x86_64/aarch64/i686/ppc64le/s390x/armv7l, macOS arm64/x86_64, Windows AMD64/ARM64/x86),
- builds the pyodide wheel (
cp313-pyodide_wasm32→cp313-emscripten_*_wasm32) for browser/WebAssembly use, - verifies artifact integrity (SHA-256),
- creates a GitHub Release (draft) with the artifacts,
- publishes to PyPI via trusted publishing (OIDC).
Integrity¶
Before any external distribution, verify artifact integrity (hash) as part of the release step. The workflow prints SHA-256 checksums for every artifact.