# Based on [https://packaging.python.org/tutorials/packaging-projects/]
git add .
git commit -m "version upload"
git tag "1.X.X"

# If the tag already exists add the forcing flag: -f:
git tag -f "1.0.2"

# Install setuptools and wheel: 
python3 -m pip install --user --upgrade setuptools wheel

sudo python setup.py sdist bdist_wheel
python3 -m twine upload --repository testpypi dist/*

# Install twine: 
python3 -m pip install --user --upgrade twine

# if version already exists use "--skip-exising" flag for twine --
# for test pypi:
python3 -m twine upload --skip-existing --repository testpypi dist/*

# for official pypi:
python -m twine upload dist/*

# test pypi:
username: __token__
password: pypi-AgENdGVzdC5weXBpLm9yZwIkZDNlOTQwZDEtMzI2Yy00NzBjLTljYzctYjlmYTg3ZWM0ZjY5AAIleyJwZXJtaXNzaW9ucyI6ICJ1c2VyIiwgInZlcnNpb24iOiAxfQAABiD5sqm_ifoyV825Sc11oVpmHbAXN-i0NxlITcJRjIfe4g

# official pypi:
username: __token__
password: pypi-AgEIcHlwaS5vcmcCJGIxYjBmYmIxLWUyMjUtNDRmOC04ZTcwLWRmNzA1NTgzYzQ2NwACJXsicGVybWlzc2lvbnMiOiAidXNlciIsICJ2ZXJzaW9uIjogMX0AAAYgON4kwDOdLf9ncnCJIRPnCE1SEamnhPwueDiUDv_TwPk


# Install the test package:
python3 -m pip install --extra-index-url https://test.pypi.org/simple/ pobm