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