Source: http://peterdowns.com/posts/first-time-with-pypi.html
I am writing this because the site is down and I'm only able to get it from Google Cache.
Create a new file in ~/.pypirc, and populate it with the following details:
[distutils]
index-servers =
pypi
pypitest
[pypi]
repository=https://pypi.python.org/pypi
username=your_username
password=your_password
Now, set up the right permissions
$ chmod 600 ~/.pypircEnsure that your project follows a similar project structure:
root-dir/ # arbitrary working directory name
setup.py
setup.cfg
LICENSE.txt
README.md
mypackage/
__init__.py
foo.py
bar.py
baz.py
And your setup.py is setup as such:
from distutils.core import setup
setup(
name = 'mypackage',
packages = ['mypackage'], # this must be the same as the name above
version = '0.1',
description = 'A random test lib',
author = 'Peter Downs',
author_email = '[email protected]',
url = 'https://github.com/peterldowns/mypackage', # use the URL to the github repo
download_url = 'https://github.com/peterldowns/mypackage/archive/0.1.tar.gz', # I'll explain this in a second
keywords = ['testing', 'logging', 'example'], # arbitrary keywords
classifiers = [],
)
Ensure you have a setup.cfg
[metadata]
description-file = README.md
Make sure you have a LICENSE.txt.
First you will need to register it:
python setup.py register -r pypitestNow, upload it:
python setup.py sdist upload -r pypitestFirst you will need to register it:
python setup.py register -r pypiNow, upload it:
python setup.py sdist upload -r pypi