From: Lott, Christopher (cl778h) Date: Wed, 2 Oct 2019 17:35:10 +0000 (-0400) Subject: Add missing DRY_RUN parameter in PyPI merge X-Git-Tag: v0.45.0~6 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=refs%2Fchanges%2F01%2F61901%2F1;p=releng%2Fglobal-jjb.git Add missing DRY_RUN parameter in PyPI merge Add DRY_RUN parameter to the PyPI verify and merge template common macro because it's required by the pypi_upload.sh script. Also adjust verbosity of shell scripts - quiet down pip, add repository name to output. Change-Id: I947ee16fb6e42a6a3ec0f0de2722a6ecf7200ceb Signed-off-by: Lott, Christopher (cl778h) --- diff --git a/jjb/lf-python-jobs.yaml b/jjb/lf-python-jobs.yaml index ead9195c..5a2d193d 100644 --- a/jjb/lf-python-jobs.yaml +++ b/jjb/lf-python-jobs.yaml @@ -701,6 +701,11 @@ name: BUILD_BDIST_WHEEL default: "{dist-binary}" description: "Set to True to build a wheel" + - bool: + name: DRY_RUN + default: false + description: | + If DRY_RUN is enabled artifacts are not published. - lf_pypi_verify_builders: &lf_pypi_verify_builders name: lf-pypi-verify-builders diff --git a/releasenotes/notes/repair-pypi-parms-3a1f36834dfbc34b.yaml b/releasenotes/notes/repair-pypi-parms-3a1f36834dfbc34b.yaml new file mode 100644 index 00000000..2ce6ed89 --- /dev/null +++ b/releasenotes/notes/repair-pypi-parms-3a1f36834dfbc34b.yaml @@ -0,0 +1,7 @@ +--- +fixes: + - | + Add DRY_RUN parameter to the PyPI verify and merge template common + macro because it's required by the pypi_upload.sh script. + Adjust verbosity of shell scripts - quiet down pip, add repository + name to echo output. diff --git a/shell/pypi-dist-build.sh b/shell/pypi-dist-build.sh index eb10371b..8baeac1e 100644 --- a/shell/pypi-dist-build.sh +++ b/shell/pypi-dist-build.sh @@ -22,12 +22,14 @@ PATH=/tmp/pypi/bin:$PATH bdist="" if $BUILD_BDIST_WHEEL; then echo "INFO: installing wheel to build binary distribution" - pip install wheel + pip install -q wheel bdist="bdist_wheel" fi echo "INFO: cd to tox-dir $TOX_DIR" cd "$WORKSPACE/$TOX_DIR" + echo "INFO: creating distributions" python3 setup.py sdist $bdist + echo "---> pypi-dist-build.sh ends" diff --git a/shell/pypi-upload.sh b/shell/pypi-upload.sh index e1ecfdfb..86fff164 100644 --- a/shell/pypi-upload.sh +++ b/shell/pypi-upload.sh @@ -20,15 +20,19 @@ set -eu -o pipefail virtualenv -p python3 /tmp/pypi PATH=/tmp/pypi/bin:$PATH -pip install twine +echo "INFO: installing twine to upload distributions" +pip install -q twine + echo "INFO: cd to tox-dir $TOX_DIR" cd "$WORKSPACE/$TOX_DIR" + cmd="twine upload -r $REPOSITORY dist/*" if $DRY_RUN; then echo "INFO: dry-run is set, echoing command only" echo $cmd else - echo "INFO: uploading distributions" + echo "INFO: uploading distributions to repo $REPOSITORY" $cmd fi + echo "---> pypi-upload.sh ends"