Skip to content

Commit 7b80719

Browse files
claude-codePaebbels
andcommitted
Apply the review: 'pypi_publish_*' in CompletePipeline, one check step per format.
- CompletePipeline.yml: 'package_sdist'/'package_wheel' before the 'pypi_***' inputs; 'publish_sdist'/'publish_wheel' renamed to 'pypi_publish_sdist'/'pypi_publish_wheel', forwarded to PublishOnPyPI's 'publish_sdist'/'publish_wheel'. - PublishOnPyPI.yml: the dry run checks wheel and source package in a step each; the warning for nothing selected covers both a dry and a real run; steps '🕵️ Check that the package is PyPI-compliant', '🩺 Check ...'. - CompletePipeline page: table rows and sections in the same order, renamed. Co-Authored-By: Patrick Lehmann <Paebbels@gmail.com>
1 parent 82edd81 commit 7b80719

3 files changed

Lines changed: 61 additions & 71 deletions

File tree

‎.github/workflows/CompletePipeline.yml‎

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,16 @@ on:
177177
required: false
178178
default: 'true'
179179
type: string
180+
package_sdist:
181+
description: "If 'true', build a source distribution (*.tar.gz)."
182+
required: false
183+
default: 'true'
184+
type: string
185+
package_wheel:
186+
description: "If 'true', build a wheel (*.whl)."
187+
required: false
188+
default: 'true'
189+
type: string
180190
pypi_url:
181191
description: 'Base URL of the package registry, which is checked for an existing release.'
182192
required: false
@@ -192,22 +202,12 @@ on:
192202
required: false
193203
default: 'false'
194204
type: string
195-
package_sdist:
196-
description: "If 'true', build a source distribution (*.tar.gz)."
197-
required: false
198-
default: 'true'
199-
type: string
200-
package_wheel:
201-
description: "If 'true', build a wheel (*.whl)."
202-
required: false
203-
default: 'true'
204-
type: string
205-
publish_sdist:
205+
pypi_publish_sdist:
206206
description: "If 'true', publish the source distribution (*.tar.gz). Default changes to 'false' with @r10."
207207
required: false
208208
default: 'true'
209209
type: string
210-
publish_wheel:
210+
pypi_publish_wheel:
211211
description: "If 'true', publish the wheel (*.whl)."
212212
required: false
213213
default: 'true'
@@ -578,8 +578,8 @@ jobs:
578578
dry_run: ${{ inputs.pypi_dry_run }}
579579
pypi_upload_url: ${{ inputs.pypi_upload_url }}
580580
pypi_compliant: ${{ needs.Package.outputs.pypi_compliant }}
581-
publish_sdist: ${{ inputs.publish_sdist }}
582-
publish_wheel: ${{ inputs.publish_wheel }}
581+
publish_sdist: ${{ inputs.pypi_publish_sdist }}
582+
publish_wheel: ${{ inputs.pypi_publish_wheel }}
583583
cleanup: ${{ inputs.cleanup }}
584584
secrets:
585585
PYPI_TOKEN: ${{ secrets.PYPI_TOKEN }}

‎.github/workflows/PublishOnPyPI.yml‎

Lines changed: 9 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ jobs:
9191
name: ${{ inputs.artifact }}
9292
path: dist
9393

94-
- name: 🔍 Check that the package is PyPI-compliant
94+
- name: 🕵️ Check that the package is PyPI-compliant
9595
if: inputs.pypi_compliant == 'false'
9696
run: |
9797
ANSI_LIGHT_RED=$'\x1b[91m'
@@ -117,28 +117,18 @@ jobs:
117117
- name: ⚙ Install dependencies for packaging and release
118118
run: python -m pip install --disable-pip-version-check ${{ inputs.requirements }}
119119

120-
- name: 🔎 Check Python packages instead of publishing them
121-
if: inputs.dry_run == 'true'
122-
run: |
123-
packages=()
124-
if [[ "${{ inputs.publish_wheel }}" == "true" ]]; then
125-
packages+=(dist/*.whl)
126-
fi
127-
if [[ "${{ inputs.publish_sdist }}" == "true" ]]; then
128-
packages+=(dist/*.tar.gz)
129-
fi
120+
- name: 🩺 Check Python wheel package instead of publishing it
121+
if: inputs.dry_run == 'true' && inputs.publish_wheel == 'true'
122+
run: twine check dist/*.whl
130123

131-
if [[ ${#packages[@]} -eq 0 ]]; then
132-
printf -- "::warning title=PublishOnPyPI::Nothing to check: 'publish_wheel' and 'publish_sdist' are both 'false'.\n"
133-
elif ! twine check "${packages[@]}"; then
134-
printf -- "::error title=PublishOnPyPI::'twine check' failed for: %s\n" "${packages[*]}"
135-
exit 1
136-
fi
124+
- name: 🩺 Check Python source package instead of publishing it
125+
if: inputs.dry_run == 'true' && inputs.publish_sdist == 'true'
126+
run: twine check dist/*.tar.gz
137127

138128
- name: ⚠ Nothing selected for publishing
139-
if: inputs.dry_run != 'true' && inputs.publish_wheel != 'true' && inputs.publish_sdist != 'true'
129+
if: inputs.publish_wheel != 'true' && inputs.publish_sdist != 'true'
140130
run: |
141-
printf -- "::warning title=PublishOnPyPI::Nothing published: 'publish_wheel' and 'publish_sdist' are both 'false'.\n"
131+
printf -- "::warning title=PublishOnPyPI::Nothing published or checked: 'publish_wheel' and 'publish_sdist' are both 'false'.\n"
142132
143133
- name: ⤴ Publish Python wheel package to PyPI
144134
if: inputs.dry_run != 'true' && inputs.publish_wheel == 'true'

‎doc/JobTemplate/AllInOne/CompletePipeline.rst‎

Lines changed: 38 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,10 @@ Parameter Summary
589589
+--------------------------------------------------------------------+----------+--------+----------------------------------------------------------------------------+
590590
| :ref:`JOBTMPL/CompletePipeline/Input/check_pypi_duplicate` | no | string | ``'true'`` |
591591
+--------------------------------------------------------------------+----------+--------+----------------------------------------------------------------------------+
592+
| :ref:`JOBTMPL/CompletePipeline/Input/package_sdist` | no | string | ``'true'`` |
593+
+--------------------------------------------------------------------+----------+--------+----------------------------------------------------------------------------+
594+
| :ref:`JOBTMPL/CompletePipeline/Input/package_wheel` | no | string | ``'true'`` |
595+
+--------------------------------------------------------------------+----------+--------+----------------------------------------------------------------------------+
592596
| :ref:`JOBTMPL/CompletePipeline/Input/pypi_url` | no | string | ``'https://pypi.org'`` |
593597
+--------------------------------------------------------------------+----------+--------+----------------------------------------------------------------------------+
594598
| :ref:`JOBTMPL/CompletePipeline/Input/apptest_python_version_list` | no | string | ``''`` |
@@ -615,13 +619,9 @@ Parameter Summary
615619
+--------------------------------------------------------------------+----------+--------+----------------------------------------------------------------------------+
616620
| :ref:`JOBTMPL/CompletePipeline/Input/pypi_dry_run` | no | string | ``'false'`` |
617621
+--------------------------------------------------------------------+----------+--------+----------------------------------------------------------------------------+
618-
| :ref:`JOBTMPL/CompletePipeline/Input/package_sdist` | no | string | ``'true'`` |
619-
+--------------------------------------------------------------------+----------+--------+----------------------------------------------------------------------------+
620-
| :ref:`JOBTMPL/CompletePipeline/Input/package_wheel` | no | string | ``'true'`` |
621-
+--------------------------------------------------------------------+----------+--------+----------------------------------------------------------------------------+
622-
| :ref:`JOBTMPL/CompletePipeline/Input/publish_sdist` | no | string | ``'true'`` |
622+
| :ref:`JOBTMPL/CompletePipeline/Input/pypi_publish_sdist` | no | string | ``'true'`` |
623623
+--------------------------------------------------------------------+----------+--------+----------------------------------------------------------------------------+
624-
| :ref:`JOBTMPL/CompletePipeline/Input/publish_wheel` | no | string | ``'true'`` |
624+
| :ref:`JOBTMPL/CompletePipeline/Input/pypi_publish_wheel` | no | string | ``'true'`` |
625625
+--------------------------------------------------------------------+----------+--------+----------------------------------------------------------------------------+
626626
| :ref:`JOBTMPL/CompletePipeline/Input/pypi_upload_url` | no | string | ``'https://upload.pypi.org/legacy/'`` |
627627
+--------------------------------------------------------------------+----------+--------+----------------------------------------------------------------------------+
@@ -1194,6 +1194,32 @@ check_pypi_duplicate
11941194
``'false'`` - don't query PyPI, e.g. for a package that isn't published there.
11951195

11961196

1197+
.. _JOBTMPL/CompletePipeline/Input/package_sdist:
1198+
1199+
package_sdist
1200+
=============
1201+
1202+
:Type: string
1203+
:Required: no
1204+
:Default Value: ``'true'``
1205+
:Possible Values: ``'true'`` / ``'false'``
1206+
:Description: Build a source distribution (:file:`*.tar.gz`).
1207+
Forwarded to :ref:`JOBTMPL/Package/Input/package_sdist`.
1208+
1209+
1210+
.. _JOBTMPL/CompletePipeline/Input/package_wheel:
1211+
1212+
package_wheel
1213+
=============
1214+
1215+
:Type: string
1216+
:Required: no
1217+
:Default Value: ``'true'``
1218+
:Possible Values: ``'true'`` / ``'false'``
1219+
:Description: Build a wheel (:file:`*.whl`).
1220+
Forwarded to :ref:`JOBTMPL/Package/Input/package_wheel`.
1221+
1222+
11971223
.. _JOBTMPL/CompletePipeline/Input/pypi_url:
11981224

11991225
pypi_url
@@ -1227,36 +1253,10 @@ pypi_dry_run
12271253
``'false'`` - publish the packages; a package with direct references isn't tagged.
12281254

12291255

1230-
.. _JOBTMPL/CompletePipeline/Input/package_sdist:
1231-
1232-
package_sdist
1233-
=============
1234-
1235-
:Type: string
1236-
:Required: no
1237-
:Default Value: ``'true'``
1238-
:Possible Values: ``'true'`` / ``'false'``
1239-
:Description: Build a source distribution (:file:`*.tar.gz`).
1240-
Forwarded to :ref:`JOBTMPL/Package/Input/package_sdist`.
1241-
1256+
.. _JOBTMPL/CompletePipeline/Input/pypi_publish_sdist:
12421257

1243-
.. _JOBTMPL/CompletePipeline/Input/package_wheel:
1244-
1245-
package_wheel
1246-
=============
1247-
1248-
:Type: string
1249-
:Required: no
1250-
:Default Value: ``'true'``
1251-
:Possible Values: ``'true'`` / ``'false'``
1252-
:Description: Build a wheel (:file:`*.whl`).
1253-
Forwarded to :ref:`JOBTMPL/Package/Input/package_wheel`.
1254-
1255-
1256-
.. _JOBTMPL/CompletePipeline/Input/publish_sdist:
1257-
1258-
publish_sdist
1259-
=============
1258+
pypi_publish_sdist
1259+
==================
12601260

12611261
.. attention::
12621262

@@ -1270,10 +1270,10 @@ publish_sdist
12701270
Forwarded to :ref:`JOBTMPL/PublishOnPyPI/Input/publish_sdist`.
12711271

12721272

1273-
.. _JOBTMPL/CompletePipeline/Input/publish_wheel:
1273+
.. _JOBTMPL/CompletePipeline/Input/pypi_publish_wheel:
12741274

1275-
publish_wheel
1276-
=============
1275+
pypi_publish_wheel
1276+
==================
12771277

12781278
:Type: string
12791279
:Required: no

0 commit comments

Comments
 (0)