Repository navigation
chore: make the release publishable, and the workflow refuse a bad one - #51
Conversation
Everything a package needs before an index sees it, plus three guards the
workflow was missing.
Metadata that would have shipped wrong
Summary said "An open benchmark for LLM admission-control policies". That is
what the project was before it became a standard for policies, and the summary
is the first line a visitor to the PyPI page reads.
`license = { text = "MIT" }` is the deprecated form. Now a SPDX expression with
`license-files = ["LICENSE"]`, so the metadata carries License-Expression and the
file itself — the LICENSE in the repo is MIT and the two now agree by
construction rather than by coincidence.
No classifiers and no URLs. PyPI renders classifiers as the sidebar facets, so
without them the page said nothing about which Python versions work; and a
package page with no route back to the source is a package nobody can evaluate.
11 classifiers, Homepage/Source/Issues, and keywords.
Workflow guards
The tag must match the version in pyproject. Without it, tagging v0.1.0 while
pyproject says 0.0.1 publishes 0.0.1 under a v0.1.0 tag and nothing notices —
the tag is the name the release is remembered by.
`twine check --strict` in the build job. PyPI rejects a malformed
long_description outright and its error is far less legible than this one.
`skip-existing: true` on TestPyPI only. Rehearsing twice at one version is
normal and a hard failure on "file already exists" makes the dry run useless.
Deliberately NOT set for PyPI, where re-uploading a version is a mistake worth
stopping.
A TOML mistake worth recording: I first put `[project.urls]` in the middle of the
`[project]` table. A table header ends the current table, so every key after it —
`authors` included — was read as a URL, and the build failed with "URL `authors`
of field `project.urls` must be a string".
Both artifacts pass `twine check --strict`. The name is free on PyPI and TestPyPI,
and the `pypi` and `testpypi` GitHub environments now exist.
179 passed, lint clean.
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Trusted Publishing — the one part that needs a browserTwo forms, identical except the host. Both are required, because a tag runs TestPyPI → verify → PyPI and the first hop fails without it. 1. https://pypi.org/manage/account/publishing/2. https://test.pypi.org/manage/account/publishing/Under "Add a new pending publisher":
The environment name differs between the two forms — that is deliberate, and it is what stops a TestPyPI run from ever reaching PyPI credentials. Use pending publisher: the project does not exist on either index yet (both return 404), and a pending publisher is how the first upload creates it. No API token is stored anywhere. ThenRehearse first — Actions → Release → Run workflow → target When it is green: git tag v0.0.1 && git push origin v0.0.1A tag always does the full TestPyPI → verify → PyPI sequence; a manual run stops after TestPyPI unless it explicitly asks for What the verify step actually assertsNot just that it imports — a package that installs and then cannot make a decision has passed the wrong test: busy = Wall()({"vllm:kv_cache_usage_perc": 0.95}, request_id="r1")
assert not busy.admitted and busy.status == 503
idle = Wall()({"vllm:kv_cache_usage_perc": 0.10}, request_id="r2")
assert idle.admitted and idle.status == 200
assert KV_PRESSURE.read({}) is None # absence is never zero |
The publisher was registered on PyPI with environment `pypi-admitperf`, so the workflow has to say that. PyPI checks the environment name in the OIDC claim, and a mismatch fails at the publish step with a rejected token rather than anything that names the cause — so this is worth being exact about rather than approximately right. pypi job -> environment pypi-admitperf testpypi job -> environment testpypi-admitperf Both now exist on the repository; the unused `pypi` and `testpypi` environments are removed so there is nothing to pick the wrong one from. The header comment records both forms, including that the names differ between indexes on purpose — that difference is what stops a TestPyPI run reaching PyPI. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Everything a package needs before an index sees it, plus three guards the workflow was missing.
Metadata that would have shipped wrong
license = { text = "MIT" }, the deprecated formlicense-files = ["LICENSE"], soLicense-Expressionand the file both ship and agree by constructionWorkflow guards
The tag must match the version. Without it, tagging
v0.1.0whilepyprojectsays0.0.1publishes 0.0.1 under a v0.1.0 tag and nothing notices. The tag is the name the release is remembered by. Verified both ways:twine check --strictin the build job. PyPI rejects a malformedlong_descriptionoutright and its error is far less legible than this one.skip-existing: trueon TestPyPI only. Rehearsing twice at one version is normal, and a hard failure on "file already exists" makes the dry run useless. Deliberately not set for PyPI, where re-uploading a version is a mistake worth stopping.Verified
twine check --strictadmitperfis free on PyPI and TestPyPI (both 404)pypiandtestpypiGitHub environments createdOne mistake worth recording
I first put
[project.urls]in the middle of the[project]table. A TOML table header ends the current table, so every key after it —authorsincluded — was read as a URL, and the build failed withURL `authors` of field `project.urls` must be a string.Still needs you
Trusted Publishing, which requires a browser login. Values are in the PR discussion below.