Repository navigation
Phase 7b-1: PyPI packaging + release workflow (no publish yet) - #49
Merged
Merged
Conversation
Prepare PyPI packaging (Phase 7b). The version is now dynamic, read from __version__ in src/dowbench/__init__.py via [tool.hatch.version], removing the duplicate static version; bumped 0.0.1 -> 0.1.0 for the first public release. Adds a [tool.hatch.build.targets.sdist] file set and Homepage/Changelog to project.urls. Verified: wheel ships py.typed, attacks/data/seed.yaml, metering/pricing.yaml and all entry points; a clean-venv install runs list/scan/estimate from outside the repo; twine check passes. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014wCFhM2gxQCfJYcm4Zu6z4
A release workflow builds the sdist+wheel, runs twine check and a tag/version consistency check, and publishes via PyPI Trusted Publishing (OIDC, no stored token): TestPyPI on manual dispatch (the dry run), PyPI on a vX.Y.Z tag. Publish jobs request id-token at job level; the default token stays read-only. docs/RELEASING.md documents the one-time trusted-publisher setup (maintainer, in 7b-2), the dry run, and cutting a release. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014wCFhM2gxQCfJYcm4Zu6z4
Asserts importlib.metadata version('dowbench') == dowbench.__version__, the
console script is registered, and the provider/defense/tool_loader entry-point
groups ship their built-ins. Catches a broken build wiring without publishing.
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_014wCFhM2gxQCfJYcm4Zu6z4
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_014wCFhM2gxQCfJYcm4Zu6z4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
First half of the PyPI release (Phase 7b): make the package publish-ready and wire the release
automation — without publishing anything. The actual first publish (7b-2) needs the trusted
publishers configured on your PyPI/TestPyPI accounts, which only you can do; I'll ping you then.
Packaging
__version__insrc/dowbench/__init__.pyvia[tool.hatch.version], removing the duplicate static value inpyproject.toml. Bumped 0.0.1 → 0.1.0 for the first public release (classifier stays Alpha).[tool.hatch.build.targets.sdist]), andproject.urlsgainsHomepage + Changelog for a better PyPI page.
Release automation
.github/workflows/release.yml— builds sdist+wheel, runstwine checkand a tag↔versionconsistency check, then publishes via Trusted Publishing (OIDC), no stored token:
environment: testpypi);vX.Y.Ztag push → PyPI (environment: pypi).id-token: writeat the job level; the workflow's default token stayscontents: read.docs/RELEASING.md— the one-time trusted-publisher setup (maintainer, 7b-2), the TestPyPIdry run, and how to cut a release.
Guard test
tests/test_packaging.py— assertsimportlib.metadata.version("dowbench") == dowbench.__version__,the console script is registered, and the provider/defense/tool_loader entry-point groups ship
their built-ins. Catches broken build wiring with no publish.
Verified locally (the package-data risk from the estimate)
Built with
python -m build, then in a clean venv outside the repo:py.typed,attacks/data/seed.yaml,metering/pricing.yaml, the console scriptand all four entry-point groups;
dowbench list attacks,dowbench scan <tools.json>, anddowbench estimate <config>all runfrom outside the repo (bundled data loads), reporting version
0.1.0;twine check dist/*→ PASSED for both sdist and wheel.Not in this PR (per your decisions)
pip install dowbenchin the README yet — a badge would 404 before thefirst publish (CLAUDE.md: no invented badges), so it lands with 7b-2.
dowbench-scanAction keeps installing from git — migrating it to PyPI is a separate PRafter the first stable publish.
git clone+pip install -e .flow is unchanged (editable install still reports0.1.0).Kind
Checklist
Verification
🤖 Generated with Claude Code
https://claude.ai/code/session_014wCFhM2gxQCfJYcm4Zu6z4
Generated by Claude Code