Skip to content

Refresh CI workflows to match the stack - #53

Open
C-Achard wants to merge 3 commits into
cy/update-packaging-and-deployfrom
cy/ci-workflows
Open

C-Achard wants to merge 3 commits into
cy/update-packaging-and-deployfrom
cy/ci-workflows

Conversation

@C-Achard

@C-Achard C-Achard commented Oct 14, 2026 •

Copy link
Copy Markdown
Member

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.yml runs on v*.*.* tags only: tests, then build, then publish of the tested artifact without rebuilding.
  • test_package.yml runs on pull requests, pushes to main and manual dispatch, across Ubuntu, Windows and macOS × Python 3.10, 3.11, 3.12, matching DeepLabCut's supported versions.
  • A dependency-floor job installs the lowest version of each declared dependency on Python 3.10.
  • The build runs on every pull request, so packaging breakage (for instance package data missing from the wheel) fails earlier.
  • requires-python is >=3.10, with 3.10–3.12 classifiers, following DeepLabCut; there is no upper bound, as in DeepLabCut.
  • The ruamel.yaml floor is raised from 0.15.0 to 0.16; 0.15.x does not build on Python 3.10.

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.
@C-Achard
C-Achard added this pull request to stack #55 October 14, 2026 08:49
@C-Achard C-Achard added the CI label Oct 14, 2026
@C-Achard C-Achard self-assigned this Oct 14, 2026
@C-Achard
C-Achard requested review from AlexEMG, MMathisLab and deruyter92 and a balanced review from Copilot October 14, 2026 08:54

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

🟡 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.yaml minimum 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.

Comment thread .github/workflows/test_package.yml

@deruyter92 deruyter92 left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment thread pyproject.toml
]
license = { text = "GNU Lesser General Public License v3.0" }
requires-python = ">=3.9"
requires-python = ">=3.10"

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Good choice I think.

Reminder to bump the ruff target-version in #49 as well.

Comment on lines +3 to +7
on:
workflow_call:
workflow_dispatch:
inputs:
ref:

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

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

Comment on lines +22 to +24
- uses: actions/checkout@v6
with:
ref: ${{ inputs.ref }}

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Suggested change
- 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

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

A bit redundant maybe, but we could add a guard to stop uploading if anything produced a wrong version.

Suggested change
- 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]

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

We don't run tests on stacked PRs currently, which is fine. Just checking: is this intended?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants