Prepare for 4.0.0 release#98
Conversation
release in many years - Add build-backend to [build-system] in pyproject.toml (PEP 517) - Move from dynamic to static version in pyproject.toml (4.0.0.dev0) - Switch us/version.py to importlib.metadata with unknown fallback - Replace sed-based version replacement in publish.yml with uv version - Bump astral-sh/setup-uv from v7 to v8 across all CI jobs - Fix README: uv install -> uv add, black -> ruff in dev section - Fix CONTRIBUTING.md: black -> ruff
|
Changes to focus on in review:
|
Summary
This PR modernizes the project's packaging, tooling, and CI configuration in preparation for the 4.0.0 release — the first new release in several years.
The project was already in good shape (uv, ruff, GitHub Actions, OIDC publishing to PyPI) so this is a targeted cleanup pass rather than a full overhaul.
Changes
Packaging (
pyproject.toml)build-backend = "setuptools.build_meta"to[build-system](required by PEP 517)dynamic = ["version"](setuptools attribute lookup) to a staticversion = "4.0.0.dev0"— cleaner and compatible withuv versionfor release automationVersion module (
us/version.py)__version__string withimportlib.metadata.version("us")so the reported version always matches the installed packagetry/exceptfallback to"unknown"for environments where the package metadata isn't availableRelease workflow (
.github/workflows/publish.yml)sedregex that patchedversion.pyat release time withuv version "${GITHUB_REF#refs/tags/v}", which sets the version directly inpyproject.tomlv4.0.0→ CI runs tests →uv versionsets the version →uv build→ publishes to PyPI via Trusted Publishing (no API token needed)Documentation
README.md: fixeduv install us(not a valid command) →uv add us; replaceduv run black --check uswith the correctruffcommandsCONTRIBUTING.md: updated formatting tool reference fromblacktoruff