@@ -86,68 +86,6 @@ Using Twine
86
86
More documentation on using Twine to upload packages to PyPI is in
87
87
the `Python Packaging User Guide `_.
88
88
89
- Keyring Support
90
- ---------------
91
-
92
- Instead of typing in your password every time you upload a distribution, Twine
93
- allows storing a username and password securely using `keyring `_.
94
- Keyring is installed with Twine but for some systems (Linux mainly) may
95
- require `additional installation steps `_.
96
-
97
- Once Twine is installed, use the ``keyring `` program to set a
98
- username and password to use for each package index (repository) to
99
- which you may upload.
100
-
101
- For example, to set a username and password for PyPI:
102
-
103
- .. code-block :: console
104
-
105
- $ keyring set https://upload.pypi.org/legacy/ your-username
106
-
107
- or
108
-
109
- .. code-block :: console
110
-
111
- $ python3 -m keyring set https://upload.pypi.org/legacy/ your-username
112
-
113
- and enter the password when prompted.
114
-
115
- For a different repository, replace the URL with the relevant repository
116
- URL. For example, for Test PyPI, use ``https://test.pypi.org/legacy/ ``.
117
-
118
- The next time you run ``twine ``, it will prompt you for a username and will
119
- grab the appropriate password from the keyring.
120
-
121
- **Note: ** If you are using Linux in a headless environment (such as on a
122
- server) you'll need to do some additional steps to ensure that Keyring can
123
- store secrets securely. See `Using Keyring on headless systems `_.
124
-
125
- Disabling Keyring
126
- ^^^^^^^^^^^^^^^^^
127
-
128
- In most cases, simply not setting a password with ``keyring `` will allow Twine
129
- to fall back to prompting for a password. In some cases, the presence of
130
- Keyring will cause unexpected or undesirable prompts from the backing system.
131
- In these cases, it may be desirable to disable Keyring altogether. To disable
132
- Keyring, simply invoke:
133
-
134
- .. code-block :: console
135
-
136
- $ keyring --disable
137
-
138
- or
139
-
140
- .. code-block :: console
141
-
142
- $ python -m keyring --disable
143
-
144
- That command will configure for the current user the "null" keyring,
145
- effectively disabling the functionality, and allowing Twine to prompt
146
- for passwords.
147
-
148
- See `twine 338 <https://github.com/pypa/twine/issues/338 >`_ for
149
- discussion and background.
150
-
151
89
Commands
152
90
--------
153
91
@@ -292,8 +230,8 @@ For completeness, its usage:
292
230
containing the private key and the certificate in PEM
293
231
format.
294
232
295
- Configuration File
296
- ^^^^^^^^^^^^^^^^^^
233
+ Configuration
234
+ -------------
297
235
298
236
Twine can read repository configuration from a ``.pypirc `` file, either in your
299
237
home directory, or provided with the ``--config-file `` option. For details on
@@ -321,6 +259,68 @@ on a CI/build server).
321
259
* ``TWINE_NON_INTERACTIVE `` - Do not interactively prompt for username/password
322
260
if the required credentials are missing.
323
261
262
+ Keyring Support
263
+ ---------------
264
+
265
+ Instead of typing in your password every time you upload a distribution, Twine
266
+ allows storing a username and password securely using `keyring `_.
267
+ Keyring is installed with Twine but for some systems (Linux mainly) may
268
+ require `additional installation steps `_.
269
+
270
+ Once Twine is installed, use the ``keyring `` program to set a
271
+ username and password to use for each package index (repository) to
272
+ which you may upload.
273
+
274
+ For example, to set a username and password for PyPI:
275
+
276
+ .. code-block :: console
277
+
278
+ $ keyring set https://upload.pypi.org/legacy/ your-username
279
+
280
+ or
281
+
282
+ .. code-block :: console
283
+
284
+ $ python3 -m keyring set https://upload.pypi.org/legacy/ your-username
285
+
286
+ and enter the password when prompted.
287
+
288
+ For a different repository, replace the URL with the relevant repository
289
+ URL. For example, for Test PyPI, use ``https://test.pypi.org/legacy/ ``.
290
+
291
+ The next time you run ``twine ``, it will prompt you for a username and will
292
+ grab the appropriate password from the keyring.
293
+
294
+ **Note: ** If you are using Linux in a headless environment (such as on a
295
+ server) you'll need to do some additional steps to ensure that Keyring can
296
+ store secrets securely. See `Using Keyring on headless systems `_.
297
+
298
+ Disabling Keyring
299
+ ^^^^^^^^^^^^^^^^^
300
+
301
+ In most cases, simply not setting a password with ``keyring `` will allow Twine
302
+ to fall back to prompting for a password. In some cases, the presence of
303
+ Keyring will cause unexpected or undesirable prompts from the backing system.
304
+ In these cases, it may be desirable to disable Keyring altogether. To disable
305
+ Keyring, simply invoke:
306
+
307
+ .. code-block :: console
308
+
309
+ $ keyring --disable
310
+
311
+ or
312
+
313
+ .. code-block :: console
314
+
315
+ $ python -m keyring --disable
316
+
317
+ That command will configure for the current user the "null" keyring,
318
+ effectively disabling the functionality, and allowing Twine to prompt
319
+ for passwords.
320
+
321
+ See `twine 338 <https://github.com/pypa/twine/issues/338 >`_ for
322
+ discussion and background.
323
+
324
324
Resources
325
325
---------
326
326
0 commit comments