diff options
| author | Jason R. Coombs <jaraco@jaraco.com> | 2021-02-25 08:58:03 -0500 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-02-25 08:58:03 -0500 |
| commit | 72c7a6c4eeaf83e72e2482cd670fd1b21fa6fcc9 (patch) | |
| tree | e38e8d42d03d41c5ddfc0779fb34c97f8f37a9b9 | |
| parent | e46a4f1de965adf51fb70bef7d884ed9f422ed14 (diff) | |
| parent | 898a0b59427f143efe0bcc0cabf69007fb3ee439 (diff) | |
| download | python-setuptools-git-72c7a6c4eeaf83e72e2482cd670fd1b21fa6fcc9.tar.gz | |
Merge pull request #2580 from melissa-kun-li/fix-entry-points-name-case-sensitivity
Fix case sensitivity of entry point names and keys in setup.cfg. Fixes #1937 and fixes #2480.
| -rw-r--r-- | changelog.d/1937.change.rst | 1 | ||||
| -rw-r--r-- | setuptools/dist.py | 1 | ||||
| -rw-r--r-- | setuptools/tests/test_config.py | 18 |
3 files changed, 20 insertions, 0 deletions
diff --git a/changelog.d/1937.change.rst b/changelog.d/1937.change.rst new file mode 100644 index 00000000..acd43059 --- /dev/null +++ b/changelog.d/1937.change.rst @@ -0,0 +1 @@ +Preserved case-sensitivity of keys in setup.cfg so that entry point names are case-sensitive. Changed sensitivity of configparser. NOTE: Any projects relying on case-insensitivity will need to adapt to accept the original case as published. -- by :user:`melissa-kun-li`
\ No newline at end of file diff --git a/setuptools/dist.py b/setuptools/dist.py index 050388de..c31020f0 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -583,6 +583,7 @@ class Distribution(_Distribution): self.announce("Distribution.parse_config_files():") parser = ConfigParser() + parser.optionxform = str for filename in filenames: with io.open(filename, encoding='utf-8') as reader: if DEBUG: diff --git a/setuptools/tests/test_config.py b/setuptools/tests/test_config.py index 1dee1271..64907560 100644 --- a/setuptools/tests/test_config.py +++ b/setuptools/tests/test_config.py @@ -802,6 +802,24 @@ class TestOptions: with get_dist(tmpdir) as dist: assert dist.entry_points == expected + def test_case_sensitive_entry_points(self, tmpdir): + _, config = fake_env( + tmpdir, + '[options.entry_points]\n' + 'GROUP1 = point1 = pack.module:func, ' + '.point2 = pack.module2:func_rest [rest]\n' + 'group2 = point3 = pack.module:func2\n' + ) + + with get_dist(tmpdir) as dist: + assert dist.entry_points == { + 'GROUP1': [ + 'point1 = pack.module:func', + '.point2 = pack.module2:func_rest [rest]', + ], + 'group2': ['point3 = pack.module:func2'] + } + def test_data_files(self, tmpdir): fake_env( tmpdir, |
