From: Tom Christie Date: Thu, 4 Apr 2019 12:29:52 +0000 (+0100) Subject: Add scripts/publish X-Git-Tag: 0.0.1~5 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d8497d308e30d0805b8d1cafa77da603579480a1;p=thirdparty%2Fhttpx.git Add scripts/publish --- diff --git a/scripts/publish b/scripts/publish new file mode 100755 index 00000000..73ccae76 --- /dev/null +++ b/scripts/publish @@ -0,0 +1,28 @@ +#!/bin/sh -e + +export PACKAGE="httpcore" +export VERSION=`cat ${PACKAGE}/__init__.py | grep __version__ | sed "s/__version__ = //" | sed "s/'//g"` +export PREFIX="" +if [ -d 'venv' ] ; then + export PREFIX="venv/bin/" +fi + +scripts/clean + +if ! command -v "${PREFIX}twine" &>/dev/null ; then + echo "Unable to find the 'twine' command." + echo "Install from PyPI, using '${PREFIX}pip install twine'." + exit 1 +fi + +find ${PACKAGE} -type f -name "*.py[co]" -delete +find ${PACKAGE} -type d -name __pycache__ -delete + +${PREFIX}python setup.py sdist +${PREFIX}twine upload dist/* + +echo "You probably want to also tag the version now:" +echo "git tag -a ${VERSION} -m 'version ${VERSION}'" +echo "git push --tags" + +scripts/clean