Merged revisions 68415 via svnmerge from

svn+ssh://pythondev@svn.python.org/python/trunk

........
  r68415 | tarek.ziade | 2009-01-09 00:56:31 +0100 (Fri, 09 Jan 2009) | 1 line

  fixed #4394 make the storage of the password optional in .pypirc
........
This commit is contained in:
Tarek Ziadé 2009-01-09 00:15:45 +00:00
parent bcd5cbe01e
commit 13f7c3b6ca
9 changed files with 175 additions and 77 deletions

View file

@ -8,17 +8,17 @@ The Python Package Index (PyPI) holds meta-data describing distributions
packaged with distutils. The distutils command :command:`register` is used to
submit your distribution's meta-data to the index. It is invoked as follows::
python setup.py register
python setup.py register
Distutils will respond with the following prompt::
running register
We need to know who you are, so please choose either:
1. use your existing login,
2. register as a new user,
3. have the server generate a new password for you (and email it to you), or
4. quit
Your selection [default 1]:
running register
We need to know who you are, so please choose either:
1. use your existing login,
2. register as a new user,
3. have the server generate a new password for you (and email it to you), or
4. quit
Your selection [default 1]:
Note: if your username and password are saved locally, you will not see this
menu.
@ -55,40 +55,50 @@ The .pypirc file
The format of the :file:`.pypirc` file is as follows::
[distutils]
index-servers =
pypi
[distutils]
index-servers =
pypi
[pypi]
repository: <repository-url>
username: <username>
password: <password>
[pypi]
repository: <repository-url>
username: <username>
password: <password>
*repository* can be omitted and defaults to ``http://www.python.org/pypi``.
The *distutils* section defines a *index-servers* variable that lists the
name of all sections describing a repository.
If you want to define another server a new section can be created::
Each section describing a repository defines three variables:
[distutils]
index-servers =
pypi
other
- *repository*, that defines the url of the PyPI server. Defaults to
``http://www.python.org/pypi``.
- *username*, which is the registered username on the PyPI server.
- *password*, that will be used to authenticate. If omitted the user
will be prompt to type it when needed.
[pypi]
repository: <repository-url>
username: <username>
password: <password>
If you want to define another server a new section can be created and
listed in the *index-servers* variable::
[other]
repository: http://example.com/pypi
username: <username>
password: <password>
[distutils]
index-servers =
pypi
other
The command can then be called with the -r option::
[pypi]
repository: <repository-url>
username: <username>
password: <password>
python setup.py register -r http://example.com/pypi
[other]
repository: http://example.com/pypi
username: <username>
password: <password>
Or even with the section name::
:command:`register` can then be called with the -r option to point the
repository to work with::
python setup.py register -r other
python setup.py register -r http://example.com/pypi
The name of the section that describes the repository may also be used
for conveniency::
python setup.py register -r other

View file

@ -11,7 +11,7 @@ package data if the author of the package wishes to. The distutils command
The command is invoked immediately after building one or more distribution
files. For example, the command ::
python setup.py sdist bdist_wininst upload
python setup.py sdist bdist_wininst upload
will cause the source distribution and the Windows installer to be uploaded to
PyPI. Note that these will be uploaded even if they are built using an earlier
@ -20,11 +20,14 @@ line for the invocation including the :command:`upload` command are uploaded.
The :command:`upload` command uses the username, password, and repository URL
from the :file:`$HOME/.pypirc` file (see section :ref:`pypirc` for more on this
file).
file). If a :command:`register` command was previously called in the same command,
and if the password was entered in the prompt, :command:`upload` will reuse the
entered password. This is useful if you do not want to store a clear text
password in the :file:`$HOME/.pypirc` file.
You can specify another PyPI server with the :option:`--repository=*url*` option::
python setup.py sdist bdist_wininst upload -r http://example.com/pypi
python setup.py sdist bdist_wininst upload -r http://example.com/pypi
See section :ref:`pypirc` for more on defining several servers.
@ -38,4 +41,3 @@ Other :command:`upload` options include :option:`--repository=<url>` or
*section* the name of the section in :file:`$HOME/.pypirc`, and
:option:`--show-response` (which displays the full response text from the PyPI
server for help in debugging upload problems).