Skip to content

Instantly share code, notes, and snippets.

@filipposc5
Last active July 13, 2017 09:02
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save filipposc5/f86d889eb61b4b137f94 to your computer and use it in GitHub Desktop.
Save filipposc5/f86d889eb61b4b137f94 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$ rm -rf dist ; python setup.py sdist --formats=gztar
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
(env)classy:bootstrap-cfn filippos$
@filipposc5
Copy link
Author

  • Updated process to avoid HTTP Error.
  • Removed line as this wont be visible anymore since it only uploads .tar.gz: Uploading bootstrap_cfn-0.5.11.zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment