Release generated provider packages
This page covers release validation and artifact handling. User-facing candidate changes are in release notes; version and maintenance expectations are in compatibility and support.
Build and publish with uv
Netherframe uses uv for both building and uploading distributions. The provider
release command below also delegates uploads to uv publish after verifying its
manifest. No Twine upload command is needed.
| Step | Tool | What it does |
|---|---|---|
| Build | uv build --no-sources |
Produce source archives and wheels without workspace-only build overrides |
| Validate | poe release-check |
Verify metadata, contents, licenses, isolated installs and typing |
| Validate descriptions | twine check --strict inside the gate |
Check package descriptions/metadata without uploading |
| Upload | uv publish |
Upload the exact reviewed files to PyPI or a selected registry |
uv supports token/keyring authentication and Trusted Publishing. In configured CI,
uv publish --trusted-publishing always requires the Trusted Publishing path.
Use --dry-run to rehearse an upload without sending distributions. A dry run is
separate from the package validation gate and does not replace its checks.
Validate a workspace release
Before choosing versions and packages, compare the checkout with each distribution's latest stable, non-yanked PyPI release:
uv run poe release-changes
uv run poe release-changes --format json > /tmp/nf-release-changes.json
uv run poe release-changes --packages netherframe.core,netherframe.sdk
The script builds source archives into a temporary directory and compares their
files with the published source archives, verifying the downloads' SHA-256 hashes.
It reports added, modified and removed packaged files, including dependencies,
licenses and generated bindings. Archive timestamps, generated PKG-INFO, and
TOML formatting are ignored. Versions are compared separately: changed packages
need a bump when their current version is not newer than the published version;
version-only packages already have a newer version; version-behind flags an
older checkout. Unpublished packages are selected as new.
Choose the appropriate version increment and edit the selected packages' metadata,
then update the lockfile with uv lock. Catalogue versions follow their upstream
tools; do not automatically apply framework patch increments to them. Re-run the
report after version/dependency edits. It does not change versions or upload files.
To pass the selection to the existing validation gate:
packages=$(uv run python tools/scripts/release_changes.py --format packages) || exit 1
if [ -n "$packages" ]; then
uv run poe release-check --packages "$packages" --output-dir .nf.out/releases/changed-candidate
fi
The packages format writes only comma-separated distribution names to stdout;
JSON also includes release_packages, bump_packages and per-package file changes.
An empty selection is an empty line. A network, build or missing-source-archive
error exits nonzero without emitting a partial selection. Detection includes local
uncommitted packaged changes; commit the reviewed changes before building a
promotable candidate with --require-clean.
This checks the tracked workspace distributions, excluding generated providers/
outputs. Changes outside package archives (such as root documentation and CI)
do not select packages. It does not automatically bump downstream dependents:
review API compatibility and dependency constraints separately. release-check
includes the selected packages' internal runtime dependencies in its candidate.
Run the workspace publication gate before releasing framework packages:
uv run poe release-check --output-dir .nf.out/releases/workspace-candidate --python 3.15
Use a new output directory for each candidate. The task builds wheels from source
archives for all tracked workspace packages, runs strict Twine checks, verifies
metadata and typing markers, and installs each package into its own clean environment.
It loads runtime entry points, exercises core synthesis and the CLI, and checks
installed-wheel typing for both nf.* and netherframe.* using a generated fixture
provider. Invalid calls must fail type checking. Local ignored providers/ packages
are released separately with the provider commands below.
The gate verifies declared license expressions and the contents of every bundled
license or notice file. For the AWS lint package it loads the installed
nf.lint_packs plugin and exercises passing and failing retention checks. The full
workspace gate also checks typed imports through both namespaces.
The matching Terraform and OpenTofu binaries must be installed. Their versions, function metadata hashes and generated catalogs are checked against the release source. Placeholder catalogs and missing protocol source/license bundles fail the gate.
Only a successful run writes release.json, listing package versions, validation
steps, exact artifacts and SHA-256 hashes. It also records the Git commit/tree,
whether source was dirty, the lockfile hash, tool versions and GitHub run provenance.
Use --require-clean for a promotable candidate. Retain that manifest with dist/.
The task never uploads files. Rehearse these retained artifacts on TestPyPI:
uv publish --publish-url https://test.pypi.org/legacy/ \
.nf.out/releases/workspace-candidate/dist/*
TestPyPI needs its own account and project access. Install the uploaded Netherframe
wheels by exact version from TestPyPI with --no-deps, then resolve their external
dependencies from the normal PyPI index. Do not use --extra-index-url to mix both
indexes during this check. Run the CLI and representative imports outside the
checkout. Authenticate through the environment or keyring; never commit tokens.
Review the package READMEs before building the candidate because PyPI displays
them from the uploaded artifacts. After verifying installation from PyPI, add the
published versions and date to the release notes and root CHANGELOG.md, and update
the installation guide. Check the repository, homepage and support links before
announcing the release. Describe the homepage as planned until it is publicly reachable.
For the framework workspace, upload the reviewed release directory with uv:
uv publish --dry-run .nf.out/releases/workspace-candidate/dist/*
uv publish .nf.out/releases/workspace-candidate/dist/*
The second command uploads to PyPI by default. Use the retained directory whose
release.json and checksums you reviewed; do not substitute a newly rebuilt dist/.
Generated providers use the manifest-verifying wrapper documented below.
Manual GitHub release workflow
CI runs on pull requests and pushes to main, with Python 3.15. It uses
the framework lockfile, generates the pinned AWS and Random bindings explicitly,
then runs lint, format and unit checks and the strict documentation build. poe check-ci
runs ordinary unit tests with two workers and process/socket observation tests in a
separate serial phase, avoiding competing timing windows on small private runners.
Generated providers
are excluded from the shared workspace lockfile; locally, uv run poe ci-prepare
prepares the same prerequisites. Use uv sync --locked --inexact to retain installed
bindings, and uv run poe providers-install after generating other providers.
All qualification and publication workflows require manual dispatch. The TestPyPI
upload runs in the testpypi GitHub environment and the PyPI upload in pypi. GitHub
creates an environment without protection rules on its first use: add required
reviewers to both in the repository settings for the environments to gate uploads.
- Run Release candidate (
release-candidate.yml) onmain. Chooseall, or comma-separated dotted distribution names; internal runtime dependencies are included. The job runs checks, docs, native AWS graph qualification and artifact validation. Full candidates also exercise an installed CLI/Random consumer through synthesis, saved-plan apply, convergence and destroy, outside the checkout. - Initially leave testpypi unchecked to validate GitHub execution without uploading. This retains a candidate but cannot authorize production promotion.
- Configure separate TestPyPI access, then dispatch a candidate with testpypi checked. Upload and installation are separate jobs. Installation requires the candidate's exact wheel hashes from TestPyPI, with runtime dependencies resolved separately from ordinary PyPI, on Python 3.15. A failed, skipped or missing installation check prevents promotion.
- Run Promote candidate to PyPI (
publish.yml) onmain, supplying that successful candidate run ID. It checks repository, workflow, branch, event, attempt, status and installation result, downloads the retained bundle, and verifies every artifact against the source SHA and manifest hashes. It never rebuilds. Successful upload creates a GitHub release batch taggedrelease-<candidate-run-id>with the manifest and distributions attached. Package versions remain independent.
Candidate artifacts are retained for 30 days. Expired artifacts require a new
candidate and rehearsal. If a candidate needs another attempt, rerun all jobs so
the bundle and its installation result belong to the same attempt. Only upload
jobs receive OIDC permissions or registry tokens.
The PYPI_API_TOKEN repository secret is the initial production authentication method.
TestPyPI uses a separate TESTPYPI_API_TOKEN secret. If the appropriate token is absent,
upload requires an OIDC Trusted Publisher configured for the repository and the exact
workflow filename (release-candidate.yml for TestPyPI, publish.yml for PyPI).
Pending publishers must be configured for each selected distribution under its owning
account. Tokens stay in registry/GitHub settings, never in source or workflow inputs.
AWS graph qualification (qualification.yml) can also be dispatched independently;
it retains the native report and uploads no packages. Generated provider releases still
use the manifest-verifying provider commands below. Publish the framework dependencies
before releasing provider packages; provider generation alone does not publish them.
Provider versioning
Provider packages have two independent version inputs: the exact Terraform provider
version and the binding revision. Provider 6.71.0 starts with Python package 6.71.0;
a binding fix uses 6.71.0.1, then 6.71.0.2. A new provider release starts at revision
zero again. Regenerating never increments the revision automatically.
Requalify AWS graph state after a provider update
Generated bindings matching a new schema do not establish graph-state compatibility. The AWS extension qualifies exact releases for ownership, restricted SSM planning and refresh representations. An unqualified release retains the ordinary app-wide/full planning paths where supported; it does not inherit resource grants or planning omission.
In this monorepo, uv run poe generate-all checks qualification alignment after generation.
The same quick check runs in uv run poe check and the workspace unit suite, or on its own:
uv run poe check-aws-graph
It checks the AWS pin in nf-providers.toml, every identity/planning/refresh profile,
generated package metadata when present, and the recorded source-review/native-gate
evidence. A mismatch fails with the requalification steps. This check needs no Docker
and does not rerun native tests. Exact pins stay pinned under --update-versions;
edit the pin deliberately when adopting a new upstream release.
For each new provider release:
- Compare the qualified resource implementations, provider configuration/credential handling, region/tag interceptors and changed SDK dependencies with the previous qualified release. Record pinned source URLs/hashes and any semantic differences.
- Update the AWS pin and run
uv run poe ci-prepare. Update the exact extension profiles and native-test version expectations for the reviewed candidate. Keep unreviewed versions excluded; do not widen the qualification to a version range. - Run the full qualification task on a Docker host:
uv run poe test-aws-graph
It runs extension/core unit gates and all seven native PostgreSQL/FakeCloud suites
with the installed, pinned provider. Every native suite must run, with zero failures,
errors or skips. Ambient PYTEST_ADDOPTS filters are removed. Missing bindings,
cached binaries or container support fail the task. It uses isolated FakeCloud
accounts and needs no live AWS credentials.
4. Review .nf.out/qualification/aws-graph-results.json. Only a successful run writes
this summary, including the provider binary SHA-256 and per-suite counts; a failed
rerun removes a previous summary. Retain it as aws-<version>-results.json beside
aws-<version>-source-review.json and an aws-<version>.md review under
specs/graph-state/qualification/. Update current documentation while preserving
historical captures with their original versions. Rerun poe check-aws-graph.
The test task can run before new evidence is recorded; it never edits runtime qualifications or promotes a version automatically. Passing emulator tests supports only the exercised resource/configuration boundaries. Source review remains necessary, and these gates do not establish live AWS/KMS behavior or broader performance claims.
Build a release
From a Netherframe checkout with its development dependencies and protocol bindings installed:
uv run python -m netherframe.generation.providers.release build hashicorp/random \
--provider-version 3.7.2 \
--binding-revision 1 \
--output-dir .nf.out/releases/random-3.7.2.1
The output directory must be new. The command generates the package, runs its normal
formatting, builds a wheel and source distribution with uv build --no-sources, checks
their names and versions, and writes release.json with SHA-256 hashes. The wheel is
built from the source distribution. No upload occurs during build.
For an offline build, add --schema-path /path/to/captured-schema.json and set
UV_OFFLINE=1. The build backend must already be cached. The schema must belong to the
requested provider and version; a captured schema is trusted input, not an attestation
of which provider binary produced it.
Retain the entire release directory as an artifact: source/, dist/ and release.json.
Run the consuming application's tests, synthesis and plan checks before release. Package
validation does not prove that an infrastructure upgrade is safe.
Compatibility and provenance
Both [tool.nf] in the source package and _generation.json in the installed provider
module record:
- original provider source and version, and the binding revision
- generator distribution version
- minimum compatible
netherframe.coreversion - schema SHA-256, fingerprint format identifier, and fingerprint format version
The core floor is enforced through the package's Requires-Dist, rather than being only
informational. It currently requires netherframe.core>=0.13.0. When generation starts
using a newer core API, update MINIMUM_CORE_VERSION in providers/package_output.py
to the first core release containing that API and release that core version first.
Bump the generator distribution version when shipping generator changes as well.
The schema fingerprint normalizes decoded schema views, protobuf default fields and
native/CLI aliases. Equivalent native and Terraform CLI fixture schemas must produce
the same fingerprint in the provider golden test. It is a provenance identifier,
not a determination of schema compatibility. A normalization change requires incrementing
SCHEMA_HASH_FORMAT.
Released fingerprint format nf-provider-schema version 1 preserves attribute names,
nested-block names and object-type field names verbatim. Names such as version and
nesting are user schema data at those boundaries. Compare hashes that share both
the format identifier and version. Development packages lack the format identifier.
Publish reviewed artifacts
First validate the upload command without sending files:
uv run python -m netherframe.generation.providers.release publish \
.nf.out/releases/random-3.7.2.1/release.json --dry-run
After reviewing and testing the artifacts, publish those exact files:
uv run python -m netherframe.generation.providers.release publish \
.nf.out/releases/random-3.7.2.1/release.json
Publishing verifies every recorded hash and uploads only the recorded wheel and source
distribution. It does not regenerate or rebuild, and rejects changed files and artifact
paths outside dist/. A hash manifest detects changes after review; retain it with the
artifacts in your trusted CI artifact store.
Authentication is delegated to uv: use UV_PUBLISH_TOKEN, uv's keyring integration or
trusted publishing configured on the registry. Keep credentials out of command arguments
and artifacts. The default destination is PyPI. Use --publish-url or UV_PUBLISH_URL
for the registry's upload endpoint, not its simple package index URL.
# Exercise the release on TestPyPI before the production upload.
uv run python -m netherframe.generation.providers.release publish \
.nf.out/releases/random-3.7.2.1/release.json \
--publish-url https://test.pypi.org/legacy/
A labelled provider build (<release>-<label>) is released as a local version
(<release>.<revision>+<label>), and its Terraform pin keeps the label. PyPI and TestPyPI reject
local versions, and the release command refuses to upload one there: publish it to a private index.
Automation
These commands are noninteractive and can run on the current Linux release host or a CI
runner. Use two jobs: build and test without upload credentials, then download the retained
release directory and run publish in the release job. A registry token or trusted-publisher
registration must be configured by the registry owner before that job can upload.
Use an explicit provider version and binding revision in the job's inputs; avoid latest.
Retain the manifest and checksums with release notes. On a retry, reuse the same artifacts.
If an upload partially succeeded, inspect the registry before retrying: changing a file
under an existing release version requires a new binding revision.
See uv's build and publish guide for registry authentication and trusted publishing setup.