From b2f075893117fbdbef7a9d643b00fd484307633b Mon Sep 17 00:00:00 2001 From: Thomas Oettli Date: Thu, 5 Nov 2020 14:18:54 +0100 Subject: [PATCH] improve pypi build.sh and add distribute.sh --- distribution/pypi/build.sh | 13 ++++++++----- distribution/pypi/distribute.sh | 16 ++++++++++++++++ 2 files changed, 24 insertions(+), 5 deletions(-) create mode 100755 distribution/pypi/distribute.sh diff --git a/distribution/pypi/build.sh b/distribution/pypi/build.sh index c54784b..365d429 100755 --- a/distribution/pypi/build.sh +++ b/distribution/pypi/build.sh @@ -1,8 +1,11 @@ #!/bin/bash set -e -script_dir="$(dirname "$(readlink -f -- "$BASH_SOURCE")")" -pkg_dir="$(realpath "${script_dir}/../..")" -setup="$(which python) setup.py" + +PYTHON=$(which python) + +script_dir=$(dirname "$(readlink -f -- "$BASH_SOURCE")") +pkg_dir=$(realpath "${script_dir}"/../..) + cd "${pkg_dir}" -${setup} clean -${setup} sdist bdist_wheel +${PYTHON} setup.py clean +${PYTHON} setup.py sdist bdist_wheel diff --git a/distribution/pypi/distribute.sh b/distribution/pypi/distribute.sh new file mode 100755 index 0000000..d937b3d --- /dev/null +++ b/distribution/pypi/distribute.sh @@ -0,0 +1,16 @@ +#!/bin/bash +set -e + +TWINE=$(which twine) + +script_dir=$(dirname "$(readlink -f -- "$BASH_SOURCE")") +pkg_dir=$(realpath "${script_dir}/../..") + +cd "${pkg_dir}/dist" +msg="Select version to distribute (cancel with CTRL+C):" +echo "${msg}" +select version in $(find . -maxdepth 1 -type f -name "pyinotifyd-*.*.*.tar.gz" -printf "%f\n" | sed "s#\.tar\.gz##g"); do + [ -n "${version}" ] && break + echo -e "\ninvalid choice\n\n${msg}" +done +${TWINE} upload "${version}"{.tar.gz,-*.whl}