Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 1 | .. _package-upload: |
| 2 | |
| 3 | *************************************** |
| 4 | Uploading Packages to the Package Index |
| 5 | *************************************** |
| 6 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 7 | The Python Package Index (PyPI) not only stores the package info, but also the |
| 8 | package data if the author of the package wishes to. The distutils command |
| 9 | :command:`upload` pushes the distribution files to PyPI. |
| 10 | |
| 11 | The command is invoked immediately after building one or more distribution |
| 12 | files. For example, the command :: |
| 13 | |
| 14 | python setup.py sdist bdist_wininst upload |
| 15 | |
| 16 | will cause the source distribution and the Windows installer to be uploaded to |
| 17 | PyPI. Note that these will be uploaded even if they are built using an earlier |
| 18 | invocation of :file:`setup.py`, but that only distributions named on the command |
| 19 | line for the invocation including the :command:`upload` command are uploaded. |
| 20 | |
| 21 | The :command:`upload` command uses the username, password, and repository URL |
| 22 | from the :file:`$HOME/.pypirc` file (see section :ref:`pypirc` for more on this |
| 23 | file). |
| 24 | |
Alexandre Vassalotti | 5f8ced2 | 2008-05-16 00:03:33 +0000 | [diff] [blame] | 25 | You 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 | |
| 29 | See section :ref:`pypirc` for more on defining several servers. |
| 30 | |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 31 | You can use the :option:`--sign` option to tell :command:`upload` to sign each |
| 32 | uploaded file using GPG (GNU Privacy Guard). The :program:`gpg` program must |
| 33 | be available for execution on the system :envvar:`PATH`. You can also specify |
| 34 | which key to use for signing using the :option:`--identity=*name*` option. |
| 35 | |
Georg Brandl | 36ab1ef | 2009-01-03 21:17:04 +0000 | [diff] [blame^] | 36 | Other :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 Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 39 | :option:`--show-response` (which displays the full response text from the PyPI |
| 40 | server for help in debugging upload problems). |
| 41 | |