summaryrefslogtreecommitdiff
path: root/setuptools/command/upload_docs.py
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2023-01-14 11:13:55 -0500
committerJason R. Coombs <jaraco@jaraco.com>2023-01-14 11:13:55 -0500
commit245da5441248eeb2d575034d04cbc241bf545161 (patch)
treed76526e1461252cc1119cd9482a64ef1e75f7838 /setuptools/command/upload_docs.py
parentd7b783a4b8b01e58135e40bd9a1db8a82c090982 (diff)
parent82eee6a998251b33ab3984f39b25c27ca72ba8b0 (diff)
downloadpython-setuptools-git-245da5441248eeb2d575034d04cbc241bf545161.tar.gz
Merge branch 'main' into debt/remove-legacy-version
Diffstat (limited to 'setuptools/command/upload_docs.py')
-rw-r--r--setuptools/command/upload_docs.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/setuptools/command/upload_docs.py b/setuptools/command/upload_docs.py
index 845bff44..63eb28c7 100644
--- a/setuptools/command/upload_docs.py
+++ b/setuptools/command/upload_docs.py
@@ -1,4 +1,3 @@
-# -*- coding: utf-8 -*-
"""upload_docs
Implements a Distutils 'upload_docs' subcommand (upload documentation to
@@ -17,8 +16,11 @@ import itertools
import functools
import http.client
import urllib.parse
+import warnings
+
+from .._importlib import metadata
+from .. import SetuptoolsDeprecationWarning
-from pkg_resources import iter_entry_points
from .upload import upload
@@ -43,9 +45,10 @@ class upload_docs(upload):
boolean_options = upload.boolean_options
def has_sphinx(self):
- if self.upload_dir is None:
- for ep in iter_entry_points('distutils.commands', 'build_sphinx'):
- return True
+ return bool(
+ self.upload_dir is None
+ and metadata.entry_points(group='distutils.commands', name='build_sphinx')
+ )
sub_commands = [('build_sphinx', has_sphinx)]
@@ -55,6 +58,9 @@ class upload_docs(upload):
self.target_dir = None
def finalize_options(self):
+ log.warn(
+ "Upload_docs command is deprecated. Use Read the Docs "
+ "(https://readthedocs.org) instead.")
upload.finalize_options(self)
if self.upload_dir is None:
if self.has_sphinx():
@@ -66,8 +72,6 @@ class upload_docs(upload):
else:
self.ensure_dirname('upload_dir')
self.target_dir = self.upload_dir
- if 'pypi.python.org' in self.repository:
- log.warn("Upload_docs command is deprecated for PyPi. Use RTD instead.")
self.announce('Using upload directory %s' % self.target_dir)
def create_zipfile(self, filename):
@@ -87,6 +91,12 @@ class upload_docs(upload):
zip_file.close()
def run(self):
+ warnings.warn(
+ "upload_docs is deprecated and will be removed in a future "
+ "version. Use tools like httpie or curl instead.",
+ SetuptoolsDeprecationWarning,
+ )
+
# Run sub commands
for cmd_name in self.get_sub_commands():
self.run_command(cmd_name)