Deploy workflow candidate for 2.0.0rc1#55
Deploy workflow candidate for 2.0.0rc1#55C-Achard wants to merge 8 commits intocy/pre-release-fixes-2.0from
Conversation
|
@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. |
|
I added the repo to the repos that the twine key can use ✅ |
Amazing thanks ! |
|
@C-Achard we could drop 3.10; we risk perhaps running out of credits in the DLC org for too many tests :) |
|
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:
|
@MMathisLab I think the main clarification needed is whether workflows from public repositories in the org contribute to billing. Would you be able to confirm ?
I definitely agree on this if we need to drop some versions though ! |
|
Coverage report is fixed, since approval has been given I will merge this tomorrow. |
This reverts commit 09a8364.
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.
4b894e1 to
7a21521
Compare
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.
Deploy workflow using Twine for PyPI uploads with an API token.
Workflow structure:
test→test_matrix,build→build_release,publish→publish) and updated job descriptions for clarity. (.github/workflows/python-package.yml)Validation and testing enhancements:
.github/workflows/python-package.yml).github/workflows/python-package.yml)