@@ -598,7 +598,7 @@ def _parse_config_files(self, filenames=None): # noqa: C901
598
598
continue
599
599
600
600
val = parser .get (section , opt )
601
- opt = opt . replace ( '-' , '_' )
601
+ opt = self . dash_to_underscore_warning ( opt )
602
602
opt_dict [opt ] = (filename , val )
603
603
604
604
# Make the ConfigParser forget everything (so we retain
@@ -623,6 +623,21 @@ def _parse_config_files(self, filenames=None): # noqa: C901
623
623
except ValueError as e :
624
624
raise DistutilsOptionError (e ) from e
625
625
626
+ def dash_to_underscore_warning (self , opt ):
627
+ if opt in (
628
+ 'home-page' , 'download-url' , 'author-email' ,
629
+ 'maintainer-email' , 'long-description' , 'build-base' ,
630
+ 'project-urls' , 'license-file' , 'license-files' ,
631
+ 'long-description-content-type' ,
632
+ ):
633
+ underscore_opt = opt .replace ('-' , '_' )
634
+ warnings .warn (
635
+ "Usage of dash-separated '%s' will not be supported in future "
636
+ "versions. Please use the underscore name '%s' instead"
637
+ % (opt , underscore_opt ))
638
+ return underscore_opt
639
+ return opt
640
+
626
641
# FIXME: 'Distribution._set_command_options' is too complex (14)
627
642
def _set_command_options (self , command_obj , option_dict = None ): # noqa: C901
628
643
"""
0 commit comments