-
Notifications
You must be signed in to change notification settings - Fork 13
How to upload a new package on PyPi
Giovanni Pizzi edited this page Jun 2, 2020
·
5 revisions
Since I always forget, here are some instructions.
-
pip install twine
(only once) -
create
~/.pypirc
:[distutils] index-servers = pypi pypitest [pypi] username=gio.piz [pypitest] repository=https://testpypi.python.org/pypi username=gio.piz
If there are strange errors (with PyOpenSSL, alert internal error
, ContextualVersionConfict idna
, ...), one possible solution (tested on Ubuntu) is to run
pip install --upgrade pyopenssl
pip install --upgrade requests
- First, update
__version__
in the code - Also update the version in the
setup.json
file! - merge also into
master
(via a PR!) - commit and create a new tag 'vX.X.X' from the commit in master (remember to push the tag as well!)
Then:
-
clear the
build/
,dist
andqe_tools.egg-info
folders -
git pull
, then check out the tag to be sure of the version we are at:git checkout vX.Y.Z
-
python setup.py sdist bdist_wheel --universal
-
upload the package
twine upload dist/*
(to test:
pip install qe-tools
)