livery.forge._registry¶
livery.forge._registry ¶
The package-index reader: livery.forge.Registry over the simple API.
One backend for every simple-API index, PyPI and the forges' own registries alike: the simple API is the one interface they share, and "which versions of this name are published" needs nothing more. An index that answers PEP 691 JSON is read as JSON; one that answers only PEP 503 HTML (Gitea's registry does) is read from its anchors' filenames. The release train's receipt probe reads through this, so the answer must be the index's own, never a cache's.
Classes:
| Name | Description |
|---|---|
SimpleRegistry |
A simple-API index, addressed by its simple root. |
Functions:
| Name | Description |
|---|---|
purge_gitlab_packages |
Delete every PyPI package version the GitLab project at base/project holds. |
purge_packages |
Delete every kind package version owner holds on the Gitea at base. |
SimpleRegistry ¶
A simple-API index, addressed by its simple root.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
base
|
str
|
The index's simple root ( |
required |
token
|
str
|
Sent as HTTP basic auth when the index needs it;
empty reads anonymously. Basic covers the union: a
forge registry takes its account name and token, and an
API-token index takes |
''
|
username
|
str
|
The basic-auth user beside token; |
''
|
Methods:
| Name | Description |
|---|---|
versions |
The published versions of name, oldest first. |
Source code in packages/forge/src/livery/forge/_registry.py
versions ¶
The published versions of name, oldest first.
An unpublished name answers the empty tuple (the index's 404 is that answer, not an error); an unreachable index raises livery.forge.ForgeError with the reason, and so does an index whose answer is neither PEP 691 JSON nor PEP 503 HTML.
Source code in packages/forge/src/livery/forge/_registry.py
purge_gitlab_packages ¶
purge_gitlab_packages(base: str, project: str, *, token: str, names: Collection[str] | None = None, api: Callable[[str, str, str], tuple[int, object]] | None = None) -> list[str]
Delete every PyPI package version the GitLab project at base/project holds.
The GitLab half of purge_packages: a project's packages are
listed and deleted by id through /projects/:id/packages, the
project addressed by its URL-encoded path. With names, only
those packages go. Returns name==version per deleted package.
Source code in packages/forge/src/livery/forge/_registry.py
purge_packages ¶
purge_packages(base: str, owner: str, *, token: str, kind: str = 'pypi', api: Callable[[str, str, str], tuple[int, object]] | None = None, names: Collection[str] | None = None) -> list[str]
Delete every kind package version owner holds on the Gitea at base.
The workshop's CI loop publishes rehearsal releases into its dev
forge's registry, and a rebirth of the loop must publish the same
versions again, which the registry refuses while they exist.
With names, only those packages go: the loop pins a released
member to its release, and the member's stale rehearsal wheels
would shadow that release on a first-index resolve. Returns
name==version for each deleted release. api is the call
seam, (method, path, token) to (status, body), with
path below /api/v1; the default speaks to base.