One-shot multi-registry release publisher for OSS packages (Python port of @p-vbordei/agent-publish)
Project description
agent-publish (Python)
Idiomatic Python port of
@p-vbordei/agent-publish(npm v0.1.2). One-shot multi-registry release publisher for OSS packages. Reads a strictpublish.yaml, runs prechecks (clean tree, tag exists, version match), invokesnpm publishandgh release create, and emits a canonical (RFC 8785 JCS) JSON release manifest.
What's in the box
load_publish_config(path)— strict YAML schema forpublish.yamlprecheck(cwd, version, *, from_tag=None)— clean tree, tag exists, version matchbuild_manifest(...)+canonical_manifest_bytes(...)— JCS-canonical release manifestnpm_publish(...)/github_release(...)— registry adapters- CLI:
agent-publish manifest | publish [--dry-run] [--from-tag vX.Y.Z] SpawnFncallable injection — tests stubnpm/ghwithout real network
Install
pip install agent-publish
(Python 3.10+.)
Quickstart
# In a tagged repo with package.json + CHANGELOG.md + publish.yaml:
agent-publish manifest # preview the JSON release manifest
agent-publish publish --dry-run # full flow, no network writes
agent-publish publish # real: npm + GH release + manifest
Library example
The runnable version is examples/quickstart.py. It
builds a manifest in memory, stubs npm via SpawnFn so nothing hits the
network, and prints the canonical JCS bytes:
$ python examples/quickstart.py
{"registries":[{"name":"npm","package":"agent-id","provenance":true,"sha256":"sha512-Ki1ScEwgQ8K0bV2W9k7CWnHFq2x8K3T8sZ3X7K0Ld5g=","url":"https://www.npmjs.com/package/agent-id/v/0.1.0","version":"0.1.0"}],"repo":"p-vbordei/agent-id","schema":"agent-publish/release-manifest/v1","tagged_at":"2025-01-01T00:00:00.000Z","version":"0.1.0"}
Keys are RFC 8785-sorted, no whitespace — byte-identical to the TS and Rust ports on the same input.
How it relates
| Repo | Language | Status |
|---|---|---|
agent-publish |
TypeScript / Bun (reference) | @p-vbordei/agent-publish v0.1.2 |
agent-publish-py |
Python (this repo) | v0.1.0 |
agent-publish-rs |
Rust | v0.1.0 |
All three pass the same C1–C5 conformance clauses on the same fixtures.
Conformance
uv sync --extra dev
uv run pytest -v
- C1 — manifest JCS bytes are deterministic and byte-identical across ports.
- C2 —
publish --dry-runperforms zero network writes (verified via stubbedSpawnFn). - C3 — partial registry failure still emits a manifest with successful results recorded; exit code 3.
- C4 — manifest matches the v1 schema (
schema,version,repo,tagged_at,registries[]). - C5 —
publish.yamlrejects unknown keys, missing required fields, and invalid types.
Plus S1–S5 security checks (token leakage, command injection, .npmrc permissions, env scrubbing, dirty-tree guard) embedded in tests/security/.
Architecture
See docs/architecture.md for the module map, dependency choices, and the SpawnFn injection pattern.
Development
git clone https://github.com/p-vbordei/agent-publish-py
cd agent-publish-py
uv sync --extra dev
uv run pytest
uv run python examples/quickstart.py
See CONTRIBUTING.md and CHANGELOG.md.
License
Apache-2.0 — see LICENSE.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file agent_publish-0.1.0.tar.gz.
File metadata
- Download URL: agent_publish-0.1.0.tar.gz
- Upload date:
- Size: 40.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51553c0fa27079c66d2a83f8c0b0c177534e5609c4bbc156ae24595319a9f8d5
|
|
| MD5 |
12dd9ba4fea8ac807845c781d48f8a6e
|
|
| BLAKE2b-256 |
fb92152b0f0dc5109e33b8c453196a1cc8a0ad9d4ddf301c62ead1bbbb8ed5dd
|
Provenance
The following attestation bundles were made for agent_publish-0.1.0.tar.gz:
Publisher:
publish.yml on p-vbordei/agent-publish-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_publish-0.1.0.tar.gz -
Subject digest:
51553c0fa27079c66d2a83f8c0b0c177534e5609c4bbc156ae24595319a9f8d5 - Sigstore transparency entry: 1579440731
- Sigstore integration time:
-
Permalink:
p-vbordei/agent-publish-py@a16e7fce09f4cbcab471d7512def41af9e723163 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/p-vbordei
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a16e7fce09f4cbcab471d7512def41af9e723163 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file agent_publish-0.1.0-py3-none-any.whl.
File metadata
- Download URL: agent_publish-0.1.0-py3-none-any.whl
- Upload date:
- Size: 17.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
8a87ce05c3284f0873f8ba444c4c27837e3a644a83bf98c1151d77b6461f2b8c
|
|
| MD5 |
debdc76d55b37a7b407548d99e734547
|
|
| BLAKE2b-256 |
14d1820412b20a50aeb32e4c844cc89c75055d782b354dfde4f91724f510bcaa
|
Provenance
The following attestation bundles were made for agent_publish-0.1.0-py3-none-any.whl:
Publisher:
publish.yml on p-vbordei/agent-publish-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
agent_publish-0.1.0-py3-none-any.whl -
Subject digest:
8a87ce05c3284f0873f8ba444c4c27837e3a644a83bf98c1151d77b6461f2b8c - Sigstore transparency entry: 1579440966
- Sigstore integration time:
-
Permalink:
p-vbordei/agent-publish-py@a16e7fce09f4cbcab471d7512def41af9e723163 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/p-vbordei
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@a16e7fce09f4cbcab471d7512def41af9e723163 -
Trigger Event:
workflow_dispatch
-
Statement type: