Last active
July 26, 2019 15:07
-
-
Save zahna/f3252db9eaf11eb6ac1dac0dedc202ac to your computer and use it in GitHub Desktop.
Python module quick steps
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
put module code in a git repo, push to github | |
pip install -e /path/to/module/code | |
pip install -e git+https://github.com/<project.git>#egg=master <-- installs to $HOME/src/master for further developing | |
pip install git+https://github.com/<project.git>#egg=master <-- pip installs from a git repo, rather than pypi | |
register a username at both http://test.pypi.org and http://pypi.org. | |
Setup ~/.pypirc file: | |
```[distutils] | |
index-servers = | |
pypi | |
pypitest | |
[pypi] | |
username=<username> | |
password=<password> | |
[pypitest] | |
repository=https://test.pypi.org/legacy/ | |
username=<username> | |
password=<password> | |
``` | |
Update version number in setup.py | |
Run in root directory of module repo: | |
python setup.py sdist upload -r pypitest | |
python setup.py sdist upload -r pypi | |
Sometime in future: | |
python setup.py sdist | |
twine upload --repository-url https://test.pypi.org/legacy/ dist/<tarball> | |
twine upload dist/<tarball> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment