@@ -63,72 +63,17 @@ For more information and examples, see the :ref:`pip install` reference.
63
63
Basic Authentication Credentials
64
64
================================
65
65
66
- pip supports basic authentication credentials. Basically, in the URL there is
67
- a username and password separated by ``: ``.
68
-
69
- ``https://[username[:password]@]pypi.company.com/simple ``
70
-
71
- Certain special characters are not valid in the authentication part of URLs.
72
- If the user or password part of your login credentials contain any of the
73
- special characters
74
- `here <https://en.wikipedia.org/wiki/Percent-encoding#Percent-encoding_reserved_characters >`_
75
- then they must be percent-encoded. For example, for a
76
- user with username "user" and password "he//o" accessing a repository at
77
- pypi.company.com, the index URL with credentials would look like:
78
-
79
- ``
https://user:he%2F%[email protected] ``
80
-
81
- Support for percent-encoded authentication in index URLs was added in pip 10.0.0
82
- (in `#3236 <https://github.com/pypa/pip/issues/3236 >`_). Users that must use authentication
83
- for their Python repository on systems with older pip versions should make the latest
84
- get-pip.py available in their environment to bootstrap pip to a recent-enough version.
85
-
86
- For indexes that only require single-part authentication tokens, provide the token
87
- as the "username" and do not provide a password, for example -
88
-
89
-
90
-
66
+ This is now covered in {doc}`topics/authentication`.
91
67
92
68
netrc Support
93
69
-------------
94
70
95
- If no credentials are part of the URL, pip will attempt to get authentication credentials
96
- for the URL’s hostname from the user’s .netrc file. This behaviour comes from the underlying
97
- use of `requests `_ which in turn delegates it to the `Python standard library `_.
98
-
99
- The .netrc file contains login and initialization information used by the auto-login process.
100
- It resides in the user's home directory. The .netrc file format is simple. You specify lines
101
- with a machine name and follow that with lines for the login and password that are
102
- associated with that machine. Machine name is the hostname in your URL.
103
-
104
- An example .netrc for the host example.com with a user named 'daniel', using the password
105
- 'qwerty' would look like:
106
-
107
- .. code-block :: shell
108
-
109
- machine example.com
110
- login daniel
111
- password qwerty
112
-
113
- As mentioned in the `standard library docs <https://docs.python.org/3/library/netrc.html >`_,
114
- only ASCII characters are allowed. Whitespace and non-printable characters are not allowed in passwords.
115
-
71
+ This is now covered in {doc}`topics/authentication`.
116
72
117
73
Keyring Support
118
74
---------------
119
75
120
- pip also supports credentials stored in your keyring using the `keyring `_
121
- library. Note that ``keyring `` will need to be installed separately, as pip
122
- does not come with it included.
123
-
124
- .. code-block :: shell
125
-
126
- pip install keyring
127
- echo your-password | keyring set pypi.company.com your-username
128
- pip install your-package --index-url https://pypi.company.com/
129
-
130
- .. _keyring : https://pypi.org/project/keyring/
131
-
76
+ This is now covered in {doc}`topics/authentication`.
132
77
133
78
Using a Proxy Server
134
79
====================
@@ -1904,6 +1849,4 @@ announcements on the `low-traffic packaging announcements list`_ and
1904
1849
.. _low-traffic packaging announcements list : https://mail.python.org/mailman3/lists/pypi-announce.python.org/
1905
1850
.. _our survey on upgrades that create conflicts : https://docs.google.com/forms/d/e/1FAIpQLSeBkbhuIlSofXqCyhi3kGkLmtrpPOEBwr6iJA6SzHdxWKfqdA/viewform
1906
1851
.. _the official Python blog : https://blog.python.org/
1907
- .. _requests : https://requests.readthedocs.io/en/latest/user/authentication/#netrc-authentication
1908
- .. _Python standard library : https://docs.python.org/3/library/netrc.html
1909
1852
.. _Python Windows launcher : https://docs.python.org/3/using/windows.html#launcher
0 commit comments