Skip to content

Deploy workflow candidate for 2.0.0rc1#55

Open
C-Achard wants to merge 8 commits intocy/pre-release-fixes-2.0from
cy/final-deploy-workflow-2.0.0rc1
Open

Deploy workflow candidate for 2.0.0rc1#55
C-Achard wants to merge 8 commits intocy/pre-release-fixes-2.0from
cy/final-deploy-workflow-2.0.0rc1

Conversation

@C-Achard
Copy link

@C-Achard C-Achard commented Feb 24, 2026

Deploy workflow using Twine for PyPI uploads with an API token.

Workflow structure:

  • Added detailed usage comments and separated triggers for PR validation and release publishing
  • Renamed jobs (testtest_matrix, buildbuild_release, publishpublish) and updated job descriptions for clarity. (.github/workflows/python-package.yml)

Validation and testing enhancements:

  • Expanded matrix testing to run on Python 3.10, 3.11, and 3.12, ensuring compatibility across multiple versions and preventing fail-fast behavior for better diagnostics. (.github/workflows/python-package.yml)
  • Improved smoke test steps to verify package installation and import, and simplified CLI checks. (.github/workflows/python-package.yml)
  • Fixed broken coverage reporting in CI always being 0%; removed duplicate coverage summary uploads

@C-Achard C-Achard self-assigned this Feb 24, 2026
@C-Achard C-Achard added CI Related to CI, tests, workflows... packaging Related to project packaging and release labels Feb 24, 2026
@C-Achard
Copy link
Author

@MMathisLab @AlexEMG This workflow proposal is intended to match the DLC-live usage exactly, and it adds checks to ensure the distributions build and install on all supported versions.

I’d really appreciate your review and feedback or requested changes to ensure it meets our publishing expectations.
Thanks!

@MMathisLab
Copy link
Member

MMathisLab commented Feb 24, 2026

I added the repo to the repos that the twine key can use ✅

@C-Achard
Copy link
Author

I added the repo to the repos that the twine key can use ✅

Amazing thanks !

@MMathisLab
Copy link
Member

@C-Achard we could drop 3.10; we risk perhaps running out of credits in the DLC org for too many tests :)

Copy link

@deruyter92 deruyter92 left a comment

Choose a reason for hiding this comment

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

LGTM!

@deruyter92
Copy link

I know this sounds odd, but in case we are dropping a python version from the matrix, I'd be in favor of dropping 3.11 instead of 3.10:

  • Python 3.10 would be the first choice for TensorFlow users on Windows. (and is most prone to breaking, e.g. in case we added unsupported imports)
  • Python 3.12 would be the recommended version for all other users and gives a better signal for forward compatibility.

@C-Achard
Copy link
Author

C-Achard commented Feb 25, 2026

@C-Achard we could drop 3.10; we risk perhaps running out of credits in the DLC org for too many tests :)

@MMathisLab I think the main clarification needed is whether workflows from public repositories in the org contribute to billing.
I may not be aware of some policy change, but every search I did so far would imply that regular runners should not cost on public repos, even in org.
Also: cache is 10GB/repo by default, but artifact storage is plan-dependent, so it’d be good to let us know if we’re hitting storage limits, which is not tied to runner time spent but rather what they store once finished.

Would you be able to confirm ?


I know this sounds odd, but in case we are dropping a python version from the matrix, I'd be in favor of dropping 3.11 instead of 3.10:
Python 3.10 would be the first choice for TensorFlow users on Windows. (and is most prone to breaking, e.g. in case we added unsupported imports)
Python 3.12 would be the recommended version for all other users and gives a better signal for forward compatibility.

I definitely agree on this if we need to drop some versions though !

@C-Achard C-Achard linked an issue Feb 25, 2026 that may be closed by this pull request
17 tasks
@C-Achard
Copy link
Author

Coverage report is fixed, since approval has been given I will merge this tomorrow.
If there is a problem with CI usage it's a quick PR to fix

@C-Achard C-Achard mentioned this pull request Feb 25, 2026
19 tasks
@C-Achard C-Achard changed the base branch from cy/pre-release-cleanup to cy/pre-release-fixes-2.0 February 25, 2026 17:19
Simplify and reorganize the CI workflow: normalize tag pattern quoting and narrow pull_request branches/types. Add permissions.contents=read. Rename the main job to a test_matrix job that runs a Python matrix, streamline setup and pip installs, remove verbose cache steps (use setup-python cache option), and simplify build/twine checks and wheel smoke test (only imports the package; CLI smoke test removed). Add a separate build_release job (runs on tag pushes) to build distributions and upload them as artifacts. Update publish job to download artifacts, install twine, and upload to PyPI using non-interactive --skip-existing; make publish depend on build_release.
Split the workflow into validation and release paths and add clearer step names and safeguards. PRs against main/master now run a validation matrix (3.10, 3.11, 3.12) that builds the package, runs twine check, and smoke-tests installing the wheel; fail-fast is disabled to surface version-specific issues. Tag pushes matching v*.*.* trigger a canonical release build (single Python 3.12) that produces dist artifacts, uploads them as workflow artifacts, and a separate publish job downloads those artifacts and uploads them to PyPI. Other improvements: minimal permissions (contents: read), explicit checkout/setup steps, pip caching enabled, comments for clarity, and use of --skip-existing when uploading to PyPI.
Capture tox output to a file and append the coverage summary to the GitHub Actions job summary only for the ubuntu-latest / Python 3.12 matrix. Restrict Codecov uploads to that same matrix for PRs targeting main/master and point the upload at a per-environment coverage XML (coverage.py312.xml). Move coverage settings into tox.ini so tests generate env-specific .coverage files (COVERAGE_FILE) and XML reports ({toxinidir}/.coverage.{envname}.xml) for more reliable CI artifact handling.
Update GitHub Actions and tox/pyproject coverage settings so coverage output is picked up reliably. Read the tox output from tox-output.log and point the codecov action at ./.coverage.py312.xml. Stop excluding site-packages in pyproject (commented out) because it caused our installed package to be omitted from reports. Also tidy tox.ini coverage command formatting and ensure XML/term reports are emitted per envname.
Update tox.ini to set pytest --cov to {envsitepackagesdir}/dlclivegui instead of the project module name. This ensures coverage collects from the package installed into the tox environment (matching the GitHub Actions job) and avoids missing coverage when the package is not imported from the project root.
Replace the sed extraction with an awk script that starts printing at the coverage header and stops when the "Coverage XML written to file" marker is seen, preventing extraneous trailing output from being appended to the GitHub job summary. Retains the code block wrapping and || true to avoid step failures, and includes minor whitespace cleanup in the workflow file.
@C-Achard C-Achard force-pushed the cy/final-deploy-workflow-2.0.0rc1 branch from 4b894e1 to 7a21521 Compare February 25, 2026 17:33
Select the built wheel dynamically and echo its path, install the package via a file:// wheel URL including the [pytorch] extras and add PyTorch CPU index to pip, replace the multi-line import check with a single python -c import verification, and run dlclivegui --help in offscreen Qt mode. These changes make the smoke test more robust by ensuring PyTorch dependencies are resolved and exercising the CLI in a headless environment.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CI Related to CI, tests, workflows... packaging Related to project packaging and release

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Pre-release checklist

3 participants