Last active
November 29, 2020 21:17
-
-
Save jeremyfix/2524fc83e3633f697af493168319a1c6 to your computer and use it in GitHub Desktop.
Accessing your pypi credentials within a gpg encrypted file to push to PyPi with your ssh key
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# We suppose the PyPi username and password are stored as the last 2 lines of the file pypi.gpg given below | |
# then from within your python package directory, you would do : | |
# login@machine:~$ python3 setup.py sdist | |
# login@machine:~$ pypi-push | |
# File pypi-push (with +x permissions) | |
#!/bin/bash | |
TWINE_USERNAME=`gpg --decrypt --no-comments ~/.password-store/pypi.gpg 2> /dev/null | tail -n +2 | head -1` | |
TWINE_PASSWORD=`gpg --decrypt --no-comments ~/.password-store/pypi.gpg 2> /dev/null | tail -n +2 | tail -1` | |
TWINE_USERNAME=$TWINE_USERNAME TWINE_PASSWORD=$TWINE_PASSWORD twine upload dist/* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment