Modernize build: setuptools-scm, verified PyPI publishing, per-PR builds#8
Merged
Merged
Conversation
Replaces setup.py with pyproject.toml using setuptools-scm for git-tag-derived versioning, adds mypy checking and py.typed, and adds CI workflows mirroring pymonoprice: PR builds publish an installable pre-release wheel with a bot comment, cleaned up on merge/close, and tagged releases publish to PyPI via trusted publishing (OIDC) with PEP 740 attestations. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
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.
Summary
setup.pywithpyproject.toml, usingsetuptools-scmto derive the version from git tags instead of a hand-maintainedVERSIONstring.mypytype checking (configured, passing) and apy.typedmarker.ci.yml— mypy on every push/PR.pr-build.yml/pr-publish.yml— every PR builds a wheel and publishes it as an installable GitHub pre-release (pr-N), with a bot comment containing pip and Home Assistant (rymprointegration) install instructions.pr-cleanup.yml— deletes the pre-release and comment when the PR is merged or closed.release.yml— on publishing a GitHub release, builds and publishes to PyPI via trusted publishing (OIDC, no stored token) with PEP 740 attestations.The
pypiGitHub environment and PyPI trusted publisher are already configured.Test plan
python -m build --wheelproduces a correctly versioned wheel (e.g.0.0.10.dev3+...) withpy.typedincludedmypy -p pyrympropasses against the newpyproject.tomlconfigpr-build/pr-publishproduce a working pre-release + commentpr-cleanupremoves the pre-release + commentrelease.ymlpublishes to PyPI🤖 Generated with Claude Code