-
Make an account on PyPI
-
Make sure you have
twine
andwheel
installed in yourvenv
:pip install twine wheel
-
Make sure you have your
~/.pypirc
file that looks like this:
[distutils]
index-servers =
pypi
[pypi]
username=<INSERT HERE>
password=<INSERT HERE>
-
Change permissions of that file:
chmod 600 ~/.pypirc
-
Add a
setup.cfg
file that looks like this:
[metadata]
description-file = README.md
[wheel]
universal = 1
[egg_info]
tag_build =
tag_date = 0
tag_svn_revision = 0
- In your
setup.py
, make sure you have the followingclassifiers
:
classifiers=[
'Programming Language :: Python',
'Programming Language :: Python :: 2',
'Programming Language :: Python :: 2.7',
'Programming Language :: Python :: 3',
'Programming Language :: Python :: 3.5',
'Programming Language :: Python :: 3.6',
],
-
[OPTIONAL] Tag branch:
git tag <VERSION> -m "Version blah blah blah..."
and then upload:git push --tags REMOTE
-
If applicable, delete any existing
build
anddist
directories. (this avoids old versions from being re-uploaded) -
Build it:
python setup.py sdist bdist_wheel --universal
-
Then upload:
twine upload dist/*