Skip to content
Myr

publish

This file

Path

scripts/publish

28 lines · 721 bytes

Last changed by

Add scripts/publishTom Christiebefore adoptiond8497d3

History of this file

Take it

Add scripts/publishTom Christiebefore adoptiond8497d3

lines 1–28why, one step back
1#!/bin/sh -e
23export PACKAGE="httpcore"4export VERSION=`cat ${PACKAGE}/__init__.py | grep __version__ | sed "s/__version__ = //" | sed "s/'//g"`5export PREFIX=""6if [ -d 'venv' ] ; then7 export PREFIX="venv/bin/"8fi910scripts/clean1112if ! command -v "${PREFIX}twine" &>/dev/null ; then13 echo "Unable to find the 'twine' command."14 echo "Install from PyPI, using '${PREFIX}pip install twine'."15 exit 116fi1718find ${PACKAGE} -type f -name "*.py[co]" -delete19find ${PACKAGE} -type d -name __pycache__ -delete2021${PREFIX}python setup.py sdist22${PREFIX}twine upload dist/*2324echo "You probably want to also tag the version now:"25echo "git tag -a ${VERSION} -m 'version ${VERSION}'"26echo "git push --tags"2728scripts/clean