Skip to content

Instantly share code, notes, and snippets.

@bennythejudge
Forked from filipposc5/uploading-to-pypi.md
Created March 3, 2016 12:20
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 bennythejudge/1dfdbbc36fb462195d87 to your computer and use it in GitHub Desktop.
Save bennythejudge/1dfdbbc36fb462195d87 to your computer and use it in GitHub Desktop.
Uploading to pypi

Uploading to pypi

0. Before you start

Verify (in repo):

  • setup.py has been updated
  • CHANGELOG has been updated

1. Ensure credentials are there

(env)classy:bootstrap-cfn filippos$ cat ~/.pypirc
[distutils]
index-servers=pypi

[pypi]
repository = https://pypi.python.org/pypi
username = ministryofjustice
password = somepasswordhere
..

2. Install twine

create virtualenv and install twine pip install twine

3. Build archives

(env)classy:bootstrap-cfn filippos$ python setup.py sdist --formats=gztar,zip
running sdist
running egg_info
writing requirements to bootstrap_cfn.egg-info/requires.txt
writing bootstrap_cfn.egg-info/PKG-INFO
writing top-level names to bootstrap_cfn.egg-info/top_level.txt
writing dependency_links to bootstrap_cfn.egg-info/dependency_links.txt
reading manifest file 'bootstrap_cfn.egg-info/SOURCES.txt'
writing manifest file 'bootstrap_cfn.egg-info/SOURCES.txt'
running check
creating bootstrap_cfn-0.5.11
creating bootstrap_cfn-0.5.11/bootstrap_cfn
creating bootstrap_cfn-0.5.11/bootstrap_cfn.egg-info

4. Upload to pypi

(env)classy:bootstrap-cfn filippos$ twine upload dist/*
Uploading distributions to https://pypi.python.org/pypi
Uploading bootstrap_cfn-0.5.11.tar.gz
/Users/filippos/moj/env/lib/python2.7/site-packages/requests/packages/urllib3/util/ssl_.py:100: InsecurePlatformWarning: A true SSLContext object is not available. This prevents urllib3 from configuring SSL appropriately and may cause certain SSL connections to fail. For more information, see https://urllib3.readthedocs.org/en/latest/security.html#insecureplatformwarning.
  InsecurePlatformWarning
Uploading bootstrap_cfn-0.5.11.zip
(env)classy:bootstrap-cfn filippos$
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment