-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2593 from melissa-kun-li/uppercase_metadata_warning
Warn for uppercase key usage in metadata in setup.cfg, provides compatibility. Fixes #2592
- Loading branch information
Showing
3 changed files
with
35 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Made option keys in the ``[metadata]`` section of ``setup.cfg`` case-sensitive. Users having | ||
uppercase option spellings will get a warning suggesting to make them to lowercase | ||
-- by :user:`melissa-kun-li` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -526,6 +526,25 @@ def test_dash_to_underscore_warning(self, tmpdir): | |
assert metadata.author_email == '[email protected]' | ||
assert metadata.maintainer_email == '[email protected]' | ||
|
||
def test_uppercase_warning(self, tmpdir): | ||
# remove this test and the method uppercase_warning() in setuptools.dist | ||
# when no longer needed | ||
fake_env( | ||
tmpdir, | ||
'[metadata]\n' | ||
'Name = foo\n' | ||
'description = Some description\n' | ||
) | ||
msg = ("Usage of uppercase key 'Name' in 'metadata' will be deprecated in " | ||
"future versions. " | ||
"Please use lowercase 'name' instead") | ||
with pytest.warns(UserWarning, match=msg): | ||
with get_dist(tmpdir) as dist: | ||
metadata = dist.metadata | ||
|
||
assert metadata.name == 'foo' | ||
assert metadata.description == 'Some description' | ||
|
||
|
||
class TestOptions: | ||
|
||
|