diff options
| author | Melissa Li <li.melissa.kun@gmail.com> | 2021-03-05 23:03:15 -0500 |
|---|---|---|
| committer | Melissa Li <li.melissa.kun@gmail.com> | 2021-03-05 23:21:46 -0500 |
| commit | 132a6cde2a47f34680527258a3753a692e23b266 (patch) | |
| tree | 682ff5f51a75aa6cf4db9bd07dadf0b4f9eea07f /setuptools/dist.py | |
| parent | 23ee037d56a6d8ab957882e1a041f67924ae04da (diff) | |
| download | python-setuptools-git-132a6cde2a47f34680527258a3753a692e23b266.tar.gz | |
Warn for uppercase usage in setup.cfg metadata
Diffstat (limited to 'setuptools/dist.py')
| -rw-r--r-- | setuptools/dist.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/setuptools/dist.py b/setuptools/dist.py index c074468b..43a51ad8 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -599,6 +599,7 @@ class Distribution(_Distribution): val = parser.get(section, opt) opt = self.dash_to_underscore_warning(opt, section) + opt = self.uppercase_warning(opt, section) opt_dict[opt] = (filename, val) # Make the ConfigParser forget everything (so we retain @@ -636,6 +637,17 @@ class Distribution(_Distribution): % (opt, underscore_opt)) return underscore_opt + def uppercase_warning(self, opt, section): + if section in ('metadata',) and (any(c.isupper() for c in opt)): + lowercase_opt = opt.lower() + warnings.warn( + "Usage of uppercase key '%s' in '%s' will be deprecated in future " + "versions. Please use lowercase '%s' instead" + % (opt, section, lowercase_opt) + ) + return lowercase_opt + return opt + # FIXME: 'Distribution._set_command_options' is too complex (14) def _set_command_options(self, command_obj, option_dict=None): # noqa: C901 """ |
