X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=blobdiff_plain;f=shell%2Fpypi-dist-build.sh;fp=shell%2Fpypi-dist-build.sh;h=eb10371b34e86020bdcc4e15ee30326ed7b66572;hb=200c13dbad2552db1ba9cfc185b0dc40db863930;hp=0000000000000000000000000000000000000000;hpb=eeeb5656c1c3aec9ad08918b916263c81ec626b9;p=releng%2Fglobal-jjb.git diff --git a/shell/pypi-dist-build.sh b/shell/pypi-dist-build.sh new file mode 100644 index 00000000..eb10371b --- /dev/null +++ b/shell/pypi-dist-build.sh @@ -0,0 +1,33 @@ +#!/bin/bash +# SPDX-License-Identifier: EPL-1.0 +############################################################################## +# Copyright (c) 2019 The Linux Foundation and others. +# +# All rights reserved. This program and the accompanying materials +# are made available under the terms of the Eclipse Public License v1.0 +# which accompanies this distribution, and is available at +# http://www.eclipse.org/legal/epl-v10.html +############################################################################## +echo "---> pypi-dist-build.sh" + +# Script to create Python source and binary distributions +# Requires project file "setup.py" + +# Ensure we fail the job if any steps fail. +set -eu -o pipefail + +virtualenv -p python3 /tmp/pypi +PATH=/tmp/pypi/bin:$PATH + +bdist="" +if $BUILD_BDIST_WHEEL; then + echo "INFO: installing wheel to build binary distribution" + pip install 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"