Skip to content

Commit

Permalink
Provide forward compatibility for Warehouse as the default repository…
Browse files Browse the repository at this point in the history
… for the upload command.
  • Loading branch information
jaraco committed Sep 2, 2016
1 parent 1bab356 commit 7f81445
Show file tree
Hide file tree
Showing 3 changed files with 44 additions and 0 deletions.
22 changes: 22 additions & 0 deletions CHANGES.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
-------

Expand Down
17 changes: 17 additions & 0 deletions setuptools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,3 +183,20 @@ def findall(dir=os.curdir):
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
5 changes: 5 additions & 0 deletions setuptools/command/upload_docs.py
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand All @@ -53,6 +57,7 @@ def initialize_options(self):
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():
Expand Down

0 comments on commit 7f81445

Please sign in to comment.