summaryrefslogtreecommitdiff
path: root/setuptools
diff options
context:
space:
mode:
authorJason R. Coombs <jaraco@jaraco.com>2021-05-19 20:16:09 -0400
committerJason R. Coombs <jaraco@jaraco.com>2021-05-19 20:16:09 -0400
commit0c8a1cafe753fa44392b6afe8f056d2d84943cab (patch)
treea829e916dacf091cbb5c7f9b43b33d72df26a639 /setuptools
parentf08262e5af7fa20898e3b0a1d449c9f4fb24aefb (diff)
downloadpython-setuptools-git-0c8a1cafe753fa44392b6afe8f056d2d84943cab.tar.gz
Move list of commands out of command package and into package metadata.
Diffstat (limited to 'setuptools')
-rw-r--r--setuptools/command/__init__.py9
-rw-r--r--setuptools/dist.py6
2 files changed, 5 insertions, 10 deletions
diff --git a/setuptools/command/__init__.py b/setuptools/command/__init__.py
index 570e6957..b966dcea 100644
--- a/setuptools/command/__init__.py
+++ b/setuptools/command/__init__.py
@@ -1,15 +1,6 @@
-__all__ = [
- 'alias', 'bdist_egg', 'bdist_rpm', 'build_ext', 'build_py', 'develop',
- 'easy_install', 'egg_info', 'install', 'install_lib', 'rotate', 'saveopts',
- 'sdist', 'setopt', 'test', 'install_egg_info', 'install_scripts',
- 'upload_docs', 'build_clib', 'dist_info',
-]
-
from distutils.command.bdist import bdist
import sys
-from setuptools.command import install_scripts
-
if 'egg' not in bdist.format_commands:
bdist.format_command['egg'] = ('bdist_egg', "Python .egg file")
bdist.format_commands.append('egg')
diff --git a/setuptools/dist.py b/setuptools/dist.py
index 24aef1bb..bab6b444 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
@@ -639,7 +639,7 @@ class Distribution(_Distribution):
return opt
underscore_opt = opt.replace('-', '_')
- commands = distutils.command.__all__ + setuptools.command.__all__
+ commands = distutils.command.__all__ + self._setuptools_commands()
if (not section.startswith('options') and section != 'metadata'
and section not in commands):
return underscore_opt
@@ -651,6 +651,10 @@ class Distribution(_Distribution):
% (opt, underscore_opt))
return underscore_opt
+ def _setuptools_commands(self):
+ dist = pkg_resources.get_distribution('setuptools')
+ return list(dist.get_entry_map('distutils.commands'))
+
def make_option_lowercase(self, opt, section):
if section != 'metadata' or opt.islower():
return opt