From ff3447a694f3b08dae8bd5268e64aa43f05a47a9 Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Sun, 6 Feb 2022 11:20:38 -0500 Subject: Migrate remainder of 'iter_entry_points' to importlib_metadata. --- setuptools/command/upload_docs.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'setuptools/command/upload_docs.py') diff --git a/setuptools/command/upload_docs.py b/setuptools/command/upload_docs.py index 845bff44..f429f568 100644 --- a/setuptools/command/upload_docs.py +++ b/setuptools/command/upload_docs.py @@ -18,7 +18,8 @@ import functools import http.client import urllib.parse -from pkg_resources import iter_entry_points +from .._importlib import metadata + from .upload import upload @@ -43,9 +44,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)] -- cgit v1.2.1 From a5e663d83bee3ec96890a5f9b5d818c1fdd2d6bc Mon Sep 17 00:00:00 2001 From: "Jason R. Coombs" Date: Thu, 17 Feb 2022 19:36:43 -0500 Subject: Deprecated upload_docs command. Ref #2971 --- setuptools/command/upload_docs.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'setuptools/command/upload_docs.py') diff --git a/setuptools/command/upload_docs.py b/setuptools/command/upload_docs.py index f429f568..a5480005 100644 --- a/setuptools/command/upload_docs.py +++ b/setuptools/command/upload_docs.py @@ -17,8 +17,10 @@ import itertools import functools import http.client import urllib.parse +import warnings from .._importlib import metadata +from .. import SetuptoolsDeprecationWarning from .upload import upload @@ -89,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) -- cgit v1.2.1