Setting up .pypirc
explains how to setup your .pypirc file to work with Plone.org and PyPI
A typical usage is to get in the package root in a shell and type :
$ python setup.py register sdist upload
This command will register the package to PyPI, using the arguments passed to the setup function in setup.py. These arguments are the meta-data of the package, like the name of the package, its version etc. (see the Distutils documentation for the meta-data list). After it's registered, a source distribution is created locally, using the sdist command, then uploaded to PyPI.
For Python versions older than 2.6 you also need collective.dist, as detailed later in this document
To make these commands work, a .pypirc file has to be added in your home, as described in the Distutils documentation.
The Plone.org Products section, based on PloneSoftwareCenter, is now compatible with this protocol, and you can register and upload your packages there using the same command, as long as you configure properly your .pypirc file :
[distutils]
index-servers =
pypi
plone.org
[pypi]
username:user
password:password
[plone.org]
repository:http://plone.org/products
username:ploneuser
password:password
With this configuration, you will be able to publish your work to PyPI and/or Plone.org. The -r option will let you point the server to use. If your want to push your package to Plone.org, the command is:
$ python setup.py register sdist upload -r plone.org
And for PyPI :
$ python setup.py register sdist upload -r pypi
These commands will create an entry for your package, create a .tar.gz and upload it to whichever repository you chose. Only the register and upload commands are effected by the -r flag; you can use any other commands as normal regardless of which package index you're uploading to.
N.B.: If no repository is specified PyPI will be used, not Plone.org

