Skip to content

Refactor Python package release workflow#69

Closed
MMathisLab wants to merge 6 commits intomasterfrom
MMathisLab-pypi
Closed

Refactor Python package release workflow#69
MMathisLab wants to merge 6 commits intomasterfrom
MMathisLab-pypi

Conversation

@MMathisLab
Copy link
Member

@MMathisLab MMathisLab commented Mar 23, 2026

Simpler workflow, matching other DLC / M-Lab managed deploy procedures used across organization stacks.

Updated the workflow to streamline the release process and improve Python setup.
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

Refactors the GitHub Actions workflow responsible for building and publishing the Python package to PyPI, aiming to simplify the release pipeline and Python setup.

Changes:

  • Collapses prior multi-job matrix/build/publish workflow into a single release job.
  • Adds pip cache configuration and switches Python setup to actions/setup-python@v5 with python-version: 3.x.
  • Gates the publish step to run only on push events while still triggering the workflow on PR events.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link

Copilot AI commented Mar 23, 2026

@MMathisLab I've opened a new pull request, #70, to work on those changes. Once the pull request is ready, I'll request review from you.

Copy link

Copilot AI commented Mar 23, 2026

@MMathisLab I've opened a new pull request, #71, to work on those changes. Once the pull request is ready, I'll request review from you.

Copilot AI and others added 3 commits March 23, 2026 10:29
…n cache (#71)

* Initial plan

* Fix checkout order and use setup-python built-in pip cache

Co-authored-by: MMathisLab <28102185+MMathisLab@users.noreply.github.com>
Agent-Logs-Url: https://github.com/DeepLabCut/DeepLabCut-live-GUI/sessions/21ab9ebe-25bd-4963-b3c9-01ecbf60de45

* Upgrade actions/checkout and setup-python to v6

Update .github/workflows/python-package.yml to use actions/checkout@v6 and actions/setup-python@v6. Keeps the workflow up-to-date with no functional changes to Python version or caching.

* Cache only pyproject.toml in CI

Update GitHub Actions workflow to use pyproject.toml as the sole cache-dependency-path for pip, removing requirements.txt, setup.cfg, and setup.py to avoid unnecessary cache invalidation. Add a clarifying comment and clean up trailing whitespace in the workflow file.

---------

Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Co-authored-by: MMathisLab <28102185+MMathisLab@users.noreply.github.com>
Co-authored-by: Cyril Achard <cyril.achard@epfl.ch>
Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com>
Add a workflow_dispatch input (release_tag) to allow manual builds/publishes for a specific tag. Validate the provided tag format in a new bash step when triggered manually, and adjust the checkout step to use the provided tag ref for workflow_dispatch events. Also remove an obsolete comment in the Python setup step.
@C-Achard
Copy link
Contributor

Note : I added workflow_dispatch so we can manually rerun a release for a specific tag after the original tag push has already happened. That gives us a clean recovery/debug path for release tags using a release_tag input plus checkout by tag ref.

@MMathisLab If this is not desired, we can rely on GitHub’s built-in “Re-run jobs” for the original tag-triggered workflow run instead, but this will use the previous version of the workflow, not the one from this PR, as the Re-run job function uses the code from when the run was triggered, i.e. the previous version.

Copy link
Contributor

@C-Achard C-Achard left a comment

Choose a reason for hiding this comment

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

One small note for later : this updated workflow has hooks to run on PRs, but only installs python, checks out the code and installs some deps (OpenGL, packaging deps), without doing anything related to our package or the twine upload (i.e. does not build the package, validate the distribution, run smoke tests, or attempt any PyPI upload).
None of this is required for aligning the workflow however.

@C-Achard C-Achard requested a review from deruyter92 March 23, 2026 15:56
@MMathisLab
Copy link
Member Author

the issue is the permissions; see basecamp -- no action needed on this PR

@MMathisLab MMathisLab closed this Mar 23, 2026
@MMathisLab MMathisLab deleted the MMathisLab-pypi branch March 23, 2026 15:56
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.

4 participants