diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2021-05-21 17:08:16 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-05-21 17:08:16 -0400 |
| commit | c6a761fd4dd86283f25d828c7b9b56d764dcf84b (patch) | |
| tree | 4729032ad87d53eda6960e20748435894a258194 /setuptools/dist.py | |
| parent | 57002305daec1d31622927c0aea0d4e7df79ec40 (diff) | |
| parent | 1023e656f94124753e913bc070d82710a804b751 (diff) | |
| download | python-setuptools-git-c6a761fd4dd86283f25d828c7b9b56d764dcf84b.tar.gz | |
Merge pull request #2678 from pypa/feature/static-commands
Move distutils command names into package metadata and declare entry points using static config.
Diffstat (limited to 'setuptools/dist.py')
| -rw-r--r-- | setuptools/dist.py | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index 96c82409..a1b7e832 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,14 @@ class Distribution(_Distribution): % (opt, underscore_opt)) return underscore_opt + def _setuptools_commands(self): + try: + dist = pkg_resources.get_distribution('setuptools') + return list(dist.get_entry_map('distutils.commands')) + except pkg_resources.DistributionNotFound: + # during bootstrapping, distribution doesn't exist + return [] + def make_option_lowercase(self, opt, section): if section != 'metadata' or opt.islower(): return opt |
