Add a dry-run mode to PublishOnPyPI - #256
Conversation
Up to standards ✅🟢 Issues
|
| Metric | Results |
|---|---|
| Coverage variation | ✅ +0.00% coverage variation |
| Diff coverage | ✅ ∅ diff coverage |
Coverage variation details
Coverable lines Covered lines Coverage Common ancestor commit (8e631fc) 45 41 91.11% Head commit (1df25ad) 45 (+0) 41 (+0) 91.11% (+0.00%) Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch:
<coverage of head commit> - <coverage of common ancestor commit>
Diff coverage details
Coverable lines Covered lines Diff coverage Pull request (#256) 0 0 ∅ (not applicable) Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified:
<covered lines added or modified>/<coverable lines added or modified> * 100%
NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.
b19003d to
0aa4168
Compare
0aa4168 to
178c9e3
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## dev #256 +/- ##
=======================================
Coverage 82.22% 82.22%
=======================================
Files 1 1
Lines 45 45
Branches 9 9
=======================================
Hits 37 37
Misses 4 4
Partials 4 4
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
3092bfd to
1a3db89
Compare
Both verification pipelines fail on every tag at *⤴ Publish Python wheel package to PyPI* - `_Checking_SimplePackage_Pipeline.yml` and `_Checking_NamespacePackage_Pipeline.yml`, on v7.14.1 and again on v7.15.0. `myPackage` and `myFramework.Extension` are fixtures that exist to exercise the job templates; nobody publishes them. The failure only appears on tags, which is exactly the run someone checks before cutting a release. `PublishOnPyPI.yml` gains a `dry_run` input. When enabled, the two `twine upload` steps are replaced by a single `twine check dist/*.whl dist/*.tar.gz`. Everything before them is unchanged, so the artifact download, the Python setup and the dependency install are still exercised, and the package metadata is validated rather than merely built. `CompletePipeline.yml` forwards it as `pypi_dry_run`, defaulting to `'false'` so no consumer changes behaviour. Skipping the job entirely - an input that drops `PublishOnPyPI` from the pipeline - was the alternative. It would leave the job template unverified, which is what the verification pipelines exist to prevent, so a dry run that still reaches the packages was preferred. Setting `pypi_dry_run: 'true'` in the two verification pipelines is deliberately *not* part of this commit. They call `CompletePipeline.yml@dev`, so an input that exists only on this branch makes GitHub reject the workflow file before a runner is assigned - "This run likely failed because of a workflow file issue". The switch is flipped in a follow-up once this input is on `dev`. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
1a3db89 to
1df25ad
Compare
New Features
PublishOnPyPI.ymltakes adry_runinput (default'false'). When enabled, the twotwine uploadstepsare replaced by one
twine check dist/*.whl dist/*.tar.gz. Everything before them is unchanged, so the artifactdownload, the Python setup and the dependency install still run — and the package metadata is now validated
rather than merely built.
CompletePipeline.ymlforwards it aspypi_dry_run(default'false'), so no consumer changes behaviour.Bug Fixes
Both verification pipelines failed on every tag.
_Checking_SimplePackage_Pipeline.ymland_Checking_NamespacePackage_Pipeline.ymleach runCompletePipeline.ymlover a fixture package, and each diedat ⤴ Publish Python wheel package to PyPI:
myPackageandmyFramework.Extensionexist to exercise the job templates; nobody publishes them. On a branchpush the release jobs are skipped, so this only shows on a tag — which is the run someone checks before cutting
a release.
Documentation
PublishOnPyPI.rstandCompletePipeline.rstgain the new parameter in the summary table and a full inputsection. The Behavior list of
PublishOnPyPI.rstsays that steps 3 and 4 become atwine check.Others
Why a dry run rather than skipping the job. The other option was an input that drops
PublishOnPyPIfromthe pipeline entirely. That leaves the job template unverified, which is what the verification pipelines exist
to prevent — the templates are meant to demonstrate the publish path, not only to be green. A dry run keeps the
job in the graph, keeps its
needs:edges meaningful, and still reaches the packages.Pointing the fixtures at TestPyPI was the third option. It needs a repository-URL input, a second token
secret and the two fixture names registered there, and it would upload build artifacts of a package that is not
a product. It can still be added later on top of this input.
dry_runis deliberately onPublishOnPyPI.ymlrather than only in the verification pipelines: a fork thatbuilds a package it must not push under the upstream project's PyPI name needs exactly this switch.
Adding an input that nothing in this repository sets yet is the price of the
@devreference in theverification pipelines. It is the same bootstrap constraint that makes a branch's job-template changes
untestable by that branch's own CI.
Verification
twine checkwas run against both fixture packages, built the wayPackage.ymlbuilds them —python -m build --sdistandpython -m build --wheelfrom the source tree, with build isolation, so the backend resolvedpyTooling ~= 8.17itself rather than using whatever is installed. twine 7.0.0:Exit code 0 for both pipelines' packages.
twine check --strict, which turns the renderer's warnings intoerrors, passes on all four as well — so tightening the dry run to
--strictlater is available and costs nothingtoday.
Known Issues
NamespacePackagefails on tags for a second, unrelated reason as well —PDFDocumentation— so thatpipeline stays red until the MiKTeX image gains
luatex85.sty. This change removes one of its two failures.Related Issues and Pull-Requests
PublishToGitHubPages.yml, which cannot be verified at all withoutoverwriting this repository's own GitHub Pages site. A
dry_runthere would let the NamespacePackage pipelinecover the
pagespath; this pull-request does not attempt it.