blob: e3aa7c3f517614404aa4f12ce9d5c894c3d91826 [file] [log] [blame]
Georg Brandl116aa622007-08-15 14:28:22 +00001.. _package-upload:
2
3***************************************
4Uploading Packages to the Package Index
5***************************************
6
Georg Brandl116aa622007-08-15 14:28:22 +00007The Python Package Index (PyPI) not only stores the package info, but also the
8package data if the author of the package wishes to. The distutils command
9:command:`upload` pushes the distribution files to PyPI.
10
11The command is invoked immediately after building one or more distribution
12files. For example, the command ::
13
14 python setup.py sdist bdist_wininst upload
15
16will cause the source distribution and the Windows installer to be uploaded to
17PyPI. Note that these will be uploaded even if they are built using an earlier
18invocation of :file:`setup.py`, but that only distributions named on the command
19line for the invocation including the :command:`upload` command are uploaded.
20
21The :command:`upload` command uses the username, password, and repository URL
22from the :file:`$HOME/.pypirc` file (see section :ref:`pypirc` for more on this
23file).
24
Alexandre Vassalotti5f8ced22008-05-16 00:03:33 +000025You can specify another PyPI server with the :option:`--repository=*url*` option::
26
27 python setup.py sdist bdist_wininst upload -r http://example.com/pypi
28
29See section :ref:`pypirc` for more on defining several servers.
30
Georg Brandl116aa622007-08-15 14:28:22 +000031You can use the :option:`--sign` option to tell :command:`upload` to sign each
32uploaded file using GPG (GNU Privacy Guard). The :program:`gpg` program must
33be available for execution on the system :envvar:`PATH`. You can also specify
34which key to use for signing using the :option:`--identity=*name*` option.
35
Georg Brandl36ab1ef2009-01-03 21:17:04 +000036Other :command:`upload` options include :option:`--repository=<url>` or
37:option:`--repository=<section>` where *url* is the url of the server and
38*section* the name of the section in :file:`$HOME/.pypirc`, and
Georg Brandl116aa622007-08-15 14:28:22 +000039:option:`--show-response` (which displays the full response text from the PyPI
40server for help in debugging upload problems).
41