blob: 1498394481a21fe381c9746b65afb695b75242f4 [file] [log] [blame]
Georg Brandl8ec7f652007-08-15 14:28:01 +00001.. _package-index:
2
3**********************************
4Registering with the Package Index
5**********************************
6
7The Python Package Index (PyPI) holds meta-data describing distributions
8packaged with distutils. The distutils command :command:`register` is used to
9submit your distribution's meta-data to the index. It is invoked as follows::
10
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000011 python setup.py register
Georg Brandl8ec7f652007-08-15 14:28:01 +000012
13Distutils will respond with the following prompt::
14
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000015 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 Brandl8ec7f652007-08-15 14:28:01 +000022
23Note: if your username and password are saved locally, you will not see this
24menu.
25
26If you have not registered with PyPI, then you will need to do so now. You
27should choose option 2, and enter your details as required. Soon after
28submitting your details, you will receive an email which will be used to confirm
29your registration.
30
31Once you are registered, you may choose option 1 from the menu. You will be
32prompted for your PyPI username and password, and :command:`register` will then
33submit your meta-data to the index.
34
35You may submit any number of versions of your distribution to the index. If you
36alter the meta-data for a particular version, you may submit it again and the
37index will be updated.
38
39PyPI holds a record for each (name, version) combination submitted. The first
40user to submit information for a given name is designated the Owner of that
41name. They may submit changes through the :command:`register` command or through
42the web interface. They may also designate other users as Owners or Maintainers.
43Maintainers may edit the package information, but not designate other Owners or
44Maintainers.
45
46By default PyPI will list all versions of a given package. To hide certain
47versions, the Hidden property should be set to yes. This must be edited through
48the web interface.
49
50
51.. _pypirc:
52
53The .pypirc file
54================
55
Georg Brandl907a7202008-02-22 12:31:45 +000056The format of the :file:`.pypirc` file is as follows::
Georg Brandl8ec7f652007-08-15 14:28:01 +000057
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000058 [distutils]
59 index-servers =
60 pypi
Andrew M. Kuchlingaac5c862008-05-11 14:00:00 +000061
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000062 [pypi]
63 repository: <repository-url>
64 username: <username>
65 password: <password>
Georg Brandl8ec7f652007-08-15 14:28:01 +000066
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000067The *distutils* section defines a *index-servers* variable that lists the
68name of all sections describing a repository.
Georg Brandl8ec7f652007-08-15 14:28:01 +000069
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000070Each section describing a repository defines three variables:
Georg Brandl8ec7f652007-08-15 14:28:01 +000071
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000072- *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 Brandlc62ef8b2009-01-03 20:55:06 +000077
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000078If you want to define another server a new section can be created and
79listed in the *index-servers* variable::
Andrew M. Kuchlingaac5c862008-05-11 14:00:00 +000080
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000081 [distutils]
82 index-servers =
83 pypi
84 other
Andrew M. Kuchlingaac5c862008-05-11 14:00:00 +000085
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000086 [pypi]
87 repository: <repository-url>
88 username: <username>
89 password: <password>
Andrew M. Kuchlingaac5c862008-05-11 14:00:00 +000090
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000091 [other]
92 repository: http://example.com/pypi
93 username: <username>
94 password: <password>
Andrew M. Kuchlingaac5c862008-05-11 14:00:00 +000095
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000096:command:`register` can then be called with the -r option to point the
97repository to work with::
Andrew M. Kuchlingaac5c862008-05-11 14:00:00 +000098
Tarek Ziadé1a240fb2009-01-08 23:56:31 +000099 python setup.py register -r http://example.com/pypi
Andrew M. Kuchlingaac5c862008-05-11 14:00:00 +0000100
Georg Brandle83a4ad2009-03-13 19:03:58 +0000101For convenience, the name of the section that describes the repository
102may also be used::
Georg Brandlc62ef8b2009-01-03 20:55:06 +0000103
Tarek Ziadé1a240fb2009-01-08 23:56:31 +0000104 python setup.py register -r other