Skip to content

Update build and release pipeline#15

Merged
gabe-l-hart merged 4 commits into
IBM:mainfrom
mynhardtburger:pyproject
Mar 9, 2026
Merged

Update build and release pipeline#15
gabe-l-hart merged 4 commits into
IBM:mainfrom
mynhardtburger:pyproject

Conversation

@mynhardtburger

Copy link
Copy Markdown
Contributor

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.

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>
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 gabe-l-hart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for this great update @mynhardtburger! One request to add the pytest cov cli options to pyproject.toml, but otherwise this looks great.

Comment thread ci/run-tests.sh

python3 -m pytest \
--cov=aconfig \
--cov-report=term \

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to retain automatic html cov reports. I think this can be done with tool-specific arg sections in pyproject.toml.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done.

Comment thread pyproject.toml Outdated
Comment thread Dockerfile
#
# This phase sets up dependencies for the other phases
##
FROM python:3.6-slim as base

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Comment thread Dockerfile
ARG RELEASE_DRY_RUN
RUN ./ci/publish.sh

## Release Test ################################################################

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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 gabe-l-hart left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, thanks!

@gabe-l-hart
gabe-l-hart merged commit 5e7367c into IBM:main Mar 9, 2026
7 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants