Repository navigation
Conversation
Add a reusable release build workflow that builds, validates, and smoke-tests the wheel before uploading it as an artifact. Update the test workflow to cover pull requests, manual runs, a broader Python/OS matrix, and a lowest-direct-dependency check. Simplify the PyPI release workflow so tagged releases run tests, reuse the build artifact, and only handle publishing with an explicit token check.
There was a problem hiding this comment.
🟡 Changes recommended
The dependency-floor job does not currently resolve project dependencies to their declared minimum versions.
1 open finding
What changed in this PR
Refreshes CI and release automation to match supported Python versions and validate distributions before publishing.
Changes:
- Expands testing across Python 3.10–3.12 and major operating systems.
- Separates release testing, building, and publishing.
- Raises Python and
ruamel.yamlminimum versions.
| File | Description |
|---|---|
pyproject.toml |
Updates Python support and dependency floors. |
.github/workflows/test_package.yml |
Expands CI and adds dependency-floor testing. |
.github/workflows/release-pypi.yml |
Gates tag publishing on tests and builds. |
.github/workflows/build_release.yml |
Builds, validates, and tests release artifacts. |
🧠 Review effort: Balanced
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
deruyter92
left a comment
There was a problem hiding this comment.
Good updates!
Note for later: we could switch to PyPI trusted publishing more easily as well, instead of using TWINE_API_KEY.
Just minor optional comments. Apply if you think it's helpful
| ] | ||
| license = { text = "GNU Lesser General Public License v3.0" } | ||
| requires-python = ">=3.9" | ||
| requires-python = ">=3.10" |
There was a problem hiding this comment.
Good choice I think.
Reminder to bump the ruff target-version in #49 as well.
| on: | ||
| workflow_call: | ||
| workflow_dispatch: | ||
| inputs: | ||
| ref: |
There was a problem hiding this comment.
Potential issue:
inputs.ref is not defined for workflow_call -> empty string. The current fallback behavior works (checks out the ref that triggered the run), but maybe we should guard this more explicitly? See other comment in release-pypy.yml
| - uses: actions/checkout@v6 | ||
| with: | ||
| ref: ${{ inputs.ref }} |
There was a problem hiding this comment.
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ inputs.ref }} | |
| - uses: actions/checkout@v6 | |
| with: | |
| ref: ${{ inputs.ref || github.sha }} |
| concurrency: | ||
| group: pypi-deploy | ||
| cancel-in-progress: false | ||
|
|
There was a problem hiding this comment.
A bit redundant maybe, but we could add a guard to stop uploading if anything produced a wrong version.
| - name: Check built version matches the tag | |
| run: | | |
| expected="${GITHUB_REF_NAME#v}" | |
| for f in dist/*; do | |
| case "$(basename "$f")" in | |
| "dlclibrary-${expected}-"*.whl | "dlclibrary-${expected}.tar.gz") ;; | |
| *) echo "::error::$f does not match tag version ${expected}"; exit 1 ;; | |
| esac | |
| done |
| branches: [ main ] | ||
| branches: [main] | ||
| pull_request: | ||
| branches: [main] |
There was a problem hiding this comment.
We don't run tests on stacked PRs currently, which is fine. Just checking: is this intended?

Motivation
DLCLibrary's tests ran only on pushes to
main, on Python 3.9–3.10, and the release built and published in a single job without testing the built package.Other libs (napari-deeplabcut, DeepLabCut-live-GUI and DeepLabCut) test on pull requests across 3.10–3.12 and gate publishing on tests; this applies the same flow here.
Main changes
release-pypi.ymlruns onv*.*.*tags only: tests, then build, then publish of the tested artifact without rebuilding.test_package.ymlruns on pull requests, pushes tomainand manual dispatch, across Ubuntu, Windows and macOS × Python 3.10, 3.11, 3.12, matching DeepLabCut's supported versions.requires-pythonis>=3.10, with 3.10–3.12 classifiers, following DeepLabCut; there is no upper bound, as in DeepLabCut.ruamel.yamlfloor is raised from 0.15.0 to 0.16; 0.15.x does not build on Python 3.10.