Skip to content

Commit 7f81445

Browse files
committed
Provide forward compatibility for Warehouse as the default repository for the upload command.
1 parent 1bab356 commit 7f81445

File tree

3 files changed

+44
-0
lines changed

3 files changed

+44
-0
lines changed

CHANGES.rst

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,28 @@
22
CHANGES
33
=======
44

5+
v27.0.0
6+
-------
7+
8+
* Now use Warehouse by default for
9+
``upload``, patching ``distutils.config.PyPIRCCommand`` to
10+
affect default behavior.
11+
12+
Any config in .pypirc should be updated to replace
13+
14+
https://pypi.python.org/pypi/
15+
16+
with
17+
18+
https://upload.pypi.org/legacy/
19+
20+
Similarly, any passwords stored in the keyring should be
21+
updated to use this new value for "system".
22+
23+
The ``upload_docs`` command will continue to use the python.org
24+
site, but the command is now deprecated. Users are urged to use
25+
Read The Docs instead.
26+
527
v26.1.1
628
-------
729

setuptools/__init__.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -183,3 +183,20 @@ def findall(dir=os.curdir):
183183
if has_issue_12885:
184184
# fix findall bug in distutils (http://bugs.python.org/issue12885)
185185
distutils.filelist.findall = findall
186+
187+
188+
needs_warehouse = (
189+
sys.version_info < (2, 7, 13)
190+
or
191+
(3, 0) < sys.version_info < (3, 3, 7)
192+
or
193+
(3, 4) < sys.version_info < (3, 4, 6)
194+
or
195+
(3, 5) < sys.version_info <= (3, 5, 3)
196+
or
197+
(3, 6) < sys.version_info
198+
)
199+
200+
if needs_warehouse:
201+
warehouse = 'https://upload.pypi.org/legacy/'
202+
distutils.config.PyPIRCCommand.DEFAULT_REPOSITORY = warehouse

setuptools/command/upload_docs.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,10 @@ def _encode(s):
2929

3030

3131
class upload_docs(upload):
32+
# override the default repository as upload_docs isn't
33+
# supported by Warehouse (and won't be).
34+
DEFAULT_REPOSITORY = 'https://pypi.python.org/pypi/'
35+
3236
description = 'Upload documentation to PyPI'
3337

3438
user_options = [
@@ -53,6 +57,7 @@ def initialize_options(self):
5357
self.target_dir = None
5458

5559
def finalize_options(self):
60+
log.warn("Upload_docs command is deprecated. Use RTD instead.")
5661
upload.finalize_options(self)
5762
if self.upload_dir is None:
5863
if self.has_sphinx():

0 commit comments

Comments
 (0)