summaryrefslogtreecommitdiff
path: root/setuptools/dist.py
diff options
context:
space:
mode:
Diffstat (limited to 'setuptools/dist.py')
-rw-r--r--setuptools/dist.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py
index 6ae3886b..fe5bd6f8 100644
--- a/setuptools/dist.py
+++ b/setuptools/dist.py
@@ -598,7 +598,7 @@ class Distribution(_Distribution):
continue
val = parser.get(section, opt)
- opt = opt.replace('-', '_')
+ opt = self.dash_to_underscore_warning(opt)
opt_dict[opt] = (filename, val)
# Make the ConfigParser forget everything (so we retain
@@ -623,6 +623,21 @@ class Distribution(_Distribution):
except ValueError as e:
raise DistutilsOptionError(e) from e
+ def dash_to_underscore_warning(self, opt):
+ if opt in (
+ 'home-page', 'download-url', 'author-email',
+ 'maintainer-email', 'long-description', 'build-base',
+ 'project-urls', 'license-file', 'license-files',
+ 'long-description-content-type',
+ ):
+ underscore_opt = opt.replace('-', '_')
+ warnings.warn(
+ "Usage of dash-separated '%s' will not be supported in future "
+ "versions. Please use the underscore name '%s' instead"
+ % (opt, underscore_opt))
+ return underscore_opt
+ return opt
+
# FIXME: 'Distribution._set_command_options' is too complex (14)
def _set_command_options(self, command_obj, option_dict=None): # noqa: C901
"""