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) <cl778h@att.com>
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
--- /dev/null
+---
+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.
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"
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"