Skip to content

Instantly share code, notes, and snippets.

@zahna
Last active July 26, 2019 15:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zahna/f3252db9eaf11eb6ac1dac0dedc202ac to your computer and use it in GitHub Desktop.
Save zahna/f3252db9eaf11eb6ac1dac0dedc202ac to your computer and use it in GitHub Desktop.
Python module quick steps
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