About Deploying a Package to PyPI

Instead of following or trying to remember instructions of how to deploy a package to PyPI, write a simple bash script for that instead that will guide you through the process.

#!/bin/bash

echo "Uploading to Test PyPI..."

twine upload --repository testpypi dist/*

echo "Does everything look correct? (y/N)"
read answer

if [[ $answer != "y" && $answer != "Y" ]]; then
echo "Please fix what's wrong and try again."
exit 1
fi

echo "Uploading to PyPI..."

twine upload dist/*

echo "Deploy complete!"

Tips and Tricks Developer Experience Packaging Python 3 Bash Zsh twine