summaryrefslogtreecommitdiff
path: root/setuptools/dist.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/dist.py')
-rw-r--r--setuptools/dist.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py
index 70c0e6be..d1587e34 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
@@ -11,6 +11,7 @@ import distutils.log
import distutils.core
import distutils.cmd
import distutils.dist
+import distutils.command
from distutils.util import strtobool
from distutils.debug import DEBUG
from distutils.fancy_getopt import translate_longopt
@@ -29,6 +30,7 @@ from setuptools.extern import ordered_set
from . import SetuptoolsDeprecationWarning
import setuptools
+import setuptools.command
from setuptools import windows_support
from setuptools.monkey import get_unpatched
from setuptools.config import parse_configuration
@@ -629,7 +631,13 @@ class Distribution(_Distribution):
'options.extras_require', 'options.data_files',
):
return opt
+
underscore_opt = opt.replace('-', '_')
+ commands = distutils.command.__all__ + setuptools.command.__all__
+ if (not section.startswith('options') and section != 'metadata'
+ and section not in commands):
+ return underscore_opt
+
if '-' in opt:
warnings.warn(
"Usage of dash-separated '%s' will not be supported in future "