Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 1 | .. _package-index: |
| 2 | |
| 3 | ********************************** |
| 4 | Registering with the Package Index |
| 5 | ********************************** |
| 6 | |
| 7 | The Python Package Index (PyPI) holds meta-data describing distributions |
| 8 | packaged with distutils. The distutils command :command:`register` is used to |
| 9 | submit your distribution's meta-data to the index. It is invoked as follows:: |
| 10 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 11 | python setup.py register |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 12 | |
| 13 | Distutils will respond with the following prompt:: |
| 14 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 15 | running register |
| 16 | We need to know who you are, so please choose either: |
| 17 | 1. use your existing login, |
| 18 | 2. register as a new user, |
| 19 | 3. have the server generate a new password for you (and email it to you), or |
| 20 | 4. quit |
| 21 | Your selection [default 1]: |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 22 | |
| 23 | Note: if your username and password are saved locally, you will not see this |
| 24 | menu. |
| 25 | |
| 26 | If you have not registered with PyPI, then you will need to do so now. You |
| 27 | should choose option 2, and enter your details as required. Soon after |
| 28 | submitting your details, you will receive an email which will be used to confirm |
| 29 | your registration. |
| 30 | |
| 31 | Once you are registered, you may choose option 1 from the menu. You will be |
| 32 | prompted for your PyPI username and password, and :command:`register` will then |
| 33 | submit your meta-data to the index. |
| 34 | |
| 35 | You may submit any number of versions of your distribution to the index. If you |
| 36 | alter the meta-data for a particular version, you may submit it again and the |
| 37 | index will be updated. |
| 38 | |
| 39 | PyPI holds a record for each (name, version) combination submitted. The first |
| 40 | user to submit information for a given name is designated the Owner of that |
| 41 | name. They may submit changes through the :command:`register` command or through |
| 42 | the web interface. They may also designate other users as Owners or Maintainers. |
| 43 | Maintainers may edit the package information, but not designate other Owners or |
| 44 | Maintainers. |
| 45 | |
| 46 | By default PyPI will list all versions of a given package. To hide certain |
| 47 | versions, the Hidden property should be set to yes. This must be edited through |
| 48 | the web interface. |
| 49 | |
| 50 | |
| 51 | .. _pypirc: |
| 52 | |
| 53 | The .pypirc file |
| 54 | ================ |
| 55 | |
Christian Heimes | c3f30c4 | 2008-02-22 16:37:40 +0000 | [diff] [blame] | 56 | The format of the :file:`.pypirc` file is as follows:: |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 57 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 58 | [distutils] |
| 59 | index-servers = |
| 60 | pypi |
Alexandre Vassalotti | 5f8ced2 | 2008-05-16 00:03:33 +0000 | [diff] [blame] | 61 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 62 | [pypi] |
| 63 | repository: <repository-url> |
| 64 | username: <username> |
| 65 | password: <password> |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 66 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 67 | The *distutils* section defines a *index-servers* variable that lists the |
| 68 | name of all sections describing a repository. |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 69 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 70 | Each section describing a repository defines three variables: |
Georg Brandl | 116aa62 | 2007-08-15 14:28:22 +0000 | [diff] [blame] | 71 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 72 | - *repository*, that defines the url of the PyPI server. Defaults to |
| 73 | ``http://www.python.org/pypi``. |
| 74 | - *username*, which is the registered username on the PyPI server. |
| 75 | - *password*, that will be used to authenticate. If omitted the user |
| 76 | will be prompt to type it when needed. |
Georg Brandl | 48310cd | 2009-01-03 21:18:54 +0000 | [diff] [blame] | 77 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 78 | If you want to define another server a new section can be created and |
| 79 | listed in the *index-servers* variable:: |
Alexandre Vassalotti | 5f8ced2 | 2008-05-16 00:03:33 +0000 | [diff] [blame] | 80 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 81 | [distutils] |
| 82 | index-servers = |
| 83 | pypi |
| 84 | other |
Alexandre Vassalotti | 5f8ced2 | 2008-05-16 00:03:33 +0000 | [diff] [blame] | 85 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 86 | [pypi] |
| 87 | repository: <repository-url> |
| 88 | username: <username> |
| 89 | password: <password> |
Alexandre Vassalotti | 5f8ced2 | 2008-05-16 00:03:33 +0000 | [diff] [blame] | 90 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 91 | [other] |
| 92 | repository: http://example.com/pypi |
| 93 | username: <username> |
| 94 | password: <password> |
Alexandre Vassalotti | 5f8ced2 | 2008-05-16 00:03:33 +0000 | [diff] [blame] | 95 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 96 | :command:`register` can then be called with the -r option to point the |
| 97 | repository to work with:: |
Alexandre Vassalotti | 5f8ced2 | 2008-05-16 00:03:33 +0000 | [diff] [blame] | 98 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 99 | python setup.py register -r http://example.com/pypi |
Alexandre Vassalotti | 5f8ced2 | 2008-05-16 00:03:33 +0000 | [diff] [blame] | 100 | |
Georg Brandl | ae2dbe2 | 2009-03-13 19:04:40 +0000 | [diff] [blame] | 101 | For convenience, the name of the section that describes the repository |
| 102 | may also be used:: |
Georg Brandl | 48310cd | 2009-01-03 21:18:54 +0000 | [diff] [blame] | 103 | |
Tarek Ziadé | 13f7c3b | 2009-01-09 00:15:45 +0000 | [diff] [blame] | 104 | python setup.py register -r other |