summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES.rst22
-rw-r--r--setuptools/__init__.py33
-rw-r--r--setuptools/command/upload_docs.py5
3 files changed, 57 insertions, 3 deletions
diff --git a/CHANGES.rst b/CHANGES.rst
index be52f56f..a45575ac 100644
--- a/CHANGES.rst
+++ b/CHANGES.rst
@@ -2,6 +2,28 @@
CHANGES
=======
+v27.0.0
+-------
+
+* Now use Warehouse by default for
+ ``upload``, patching ``distutils.config.PyPIRCCommand`` to
+ affect default behavior.
+
+ Any config in .pypirc should be updated to replace
+
+ https://pypi.python.org/pypi/
+
+ with
+
+ https://upload.pypi.org/legacy/
+
+ Similarly, any passwords stored in the keyring should be
+ updated to use this new value for "system".
+
+ The ``upload_docs`` command will continue to use the python.org
+ site, but the command is now deprecated. Users are urged to use
+ Read The Docs instead.
+
v26.1.1
-------
diff --git a/setuptools/__init__.py b/setuptools/__init__.py
index cf0c39f2..2ca97103 100644
--- a/setuptools/__init__.py
+++ b/setuptools/__init__.py
@@ -1,6 +1,7 @@
"""Extensions to the 'distutils' for large or complex distributions"""
import os
+import sys
import functools
import distutils.core
import distutils.filelist
@@ -17,7 +18,7 @@ from setuptools.depends import Require
__all__ = [
'setup', 'Distribution', 'Feature', 'Command', 'Extension', 'Require',
- 'find_packages'
+ 'find_packages',
]
__version__ = setuptools.version.__version__
@@ -171,5 +172,31 @@ def findall(dir=os.curdir):
return list(files)
-# fix findall bug in distutils (http://bugs.python.org/issue12885)
-distutils.filelist.findall = findall
+has_issue_12885 = (
+ sys.version_info < (3, 4, 6)
+ or
+ (3, 5) < sys.version_info <= (3, 5, 3)
+ or
+ (3, 6) < sys.version_info
+)
+
+if has_issue_12885:
+ # fix findall bug in distutils (http://bugs.python.org/issue12885)
+ distutils.filelist.findall = findall
+
+
+needs_warehouse = (
+ sys.version_info < (2, 7, 13)
+ or
+ (3, 0) < sys.version_info < (3, 3, 7)
+ or
+ (3, 4) < sys.version_info < (3, 4, 6)
+ or
+ (3, 5) < sys.version_info <= (3, 5, 3)
+ or
+ (3, 6) < sys.version_info
+)
+
+if needs_warehouse:
+ warehouse = 'https://upload.pypi.org/legacy/'
+ distutils.config.PyPIRCCommand.DEFAULT_REPOSITORY = warehouse
diff --git a/setuptools/command/upload_docs.py b/setuptools/command/upload_docs.py
index ccc1c76f..269dc2d5 100644
--- a/setuptools/command/upload_docs.py
+++ b/setuptools/command/upload_docs.py
@@ -29,6 +29,10 @@ def _encode(s):
class upload_docs(upload):
+ # override the default repository as upload_docs isn't
+ # supported by Warehouse (and won't be).
+ DEFAULT_REPOSITORY = 'https://pypi.python.org/pypi/'
+
description = 'Upload documentation to PyPI'
user_options = [
@@ -53,6 +57,7 @@ class upload_docs(upload):
self.target_dir = None
def finalize_options(self):
+ log.warn("Upload_docs command is deprecated. Use RTD instead.")
upload.finalize_options(self)
if self.upload_dir is None:
if self.has_sphinx():