Update build and release pipeline#15
Conversation
Replace the legacy setup.py/requirements.txt/Docker-based build and release pipeline with a modern pyproject.toml (PEP 621) configuration using hatchling as the build backend and uv as the package manager. Key changes: - pyproject.toml is the Python standard for declarative project metadata, replacing the imperative setup.py. It provides a single file for build system config, metadata, dependencies, and tool settings. - hatchling is used as the build backend with hatch-vcs for dynamic versioning derived from git tags, eliminating the RELEASE_VERSION env var. hatch-vcs wraps setuptools-scm under the hood: https://github.com/pypa/setuptools-scm - Dependencies are consolidated into pyproject.toml using dependency groups: runtime deps under [project.dependencies] and test tooling under [project.optional-dependencies] test. This replaces the separate requirements.txt and requirements_test.txt files and enables `uv sync --extra test` or `pip install .[test]`. - GitHub Actions workflows modernized to use uv directly instead of Docker multi-stage builds. Tests now run across a Python 3.9-3.13 matrix. Release workflow uses `uv build` (sdist + wheel) and `uv publish`. - Deleted obsolete files: setup.py, requirements.txt, requirements_test.txt, Dockerfile, ci/Dockerfile, ci/publish.sh, ci/release.sh. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED Signed-off-by: Mynhardt Burger <mynhardt@gmail.com>
2211b20 to
adfd21d
Compare
No longer referenced by any workflow or Dockerfile. Local testing is done with `uv run pytest`. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED Signed-off-by: Mynhardt Burger <mynhardt@gmail.com>
gabe-l-hart
left a comment
There was a problem hiding this comment.
Thanks for this great update @mynhardtburger! One request to add the pytest cov cli options to pyproject.toml, but otherwise this looks great.
|
|
||
| python3 -m pytest \ | ||
| --cov=aconfig \ | ||
| --cov-report=term \ |
There was a problem hiding this comment.
I would like to retain automatic html cov reports. I think this can be done with tool-specific arg sections in pyproject.toml.
| # | ||
| # This phase sets up dependencies for the other phases | ||
| ## | ||
| FROM python:3.6-slim as base |
There was a problem hiding this comment.
Interesting. I knew I had a long tail for backwards compatibility, but I'd forgotten how far back this went. I think it's very fair to bump the floor to 3.9 at this point, but we'll want to make very clear that this no longer tests compatibility with 3.6-3.8.
| ARG RELEASE_DRY_RUN | ||
| RUN ./ci/publish.sh | ||
|
|
||
| ## Release Test ################################################################ |
There was a problem hiding this comment.
It looks like we're losing this validation of release availability, but that's probably fine since we're using standard release actions now.
Signed-off-by: Mynhardt Burger <mynhardt@gmail.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
Signed-off-by: Mynhardt Burger <mynhardt@gmail.com> rh-pre-commit.version: 2.3.2 rh-pre-commit.check-secrets: ENABLED
gabe-l-hart
left a comment
There was a problem hiding this comment.
Looks great, thanks!
Replace the legacy setup.py/requirements.txt/Docker-based build and release pipeline with a modern pyproject.toml (PEP 621) configuration using hatchling as the build backend and uv as the package manager.
Key changes:
pyproject.toml is the Python standard for declarative project metadata, replacing the imperative setup.py. It provides a single file for build system config, metadata, dependencies, and tool settings.
hatchling is used as the build backend with hatch-vcs for dynamic versioning derived from git tags, eliminating the RELEASE_VERSION env var. hatch-vcs wraps setuptools-scm under the hood: https://github.com/pypa/setuptools-scm
Dependencies are consolidated into pyproject.toml using dependency groups: runtime deps under [project.dependencies] and test tooling under [project.optional-dependencies] test. This replaces the separate requirements.txt and requirements_test.txt files and enables
uv sync --extra testorpip install .[test].GitHub Actions workflows modernized to use uv directly instead of Docker multi-stage builds. Tests now run across a Python 3.9-3.13 matrix. Release workflow uses
uv build(sdist + wheel) anduv publish.Deleted obsolete files: setup.py, requirements.txt, requirements_test.txt, Dockerfile, ci/Dockerfile, ci/publish.sh, ci/release.sh.