From e39a70789201eb4ee2d40b67f7654aec0c8e3a3f Mon Sep 17 00:00:00 2001 From: JinWang An Date: Mon, 27 Mar 2023 17:02:36 +0900 Subject: [PATCH] Imported Upstream version 58.0.4 --- .bumpversion.cfg | 2 +- CHANGES.rst | 9 +++++++++ setup.cfg | 2 +- setuptools/command/setopt.py | 1 + setuptools/tests/test_setopt.py | 8 ++++++++ 5 files changed, 20 insertions(+), 2 deletions(-) diff --git a/.bumpversion.cfg b/.bumpversion.cfg index c95f09e..4871a5e 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 58.0.3 +current_version = 58.0.4 commit = True tag = True diff --git a/CHANGES.rst b/CHANGES.rst index a919b31..dab7400 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,12 @@ +v58.0.4 +------- + + +Misc +^^^^ +* #2773: Retain case in setup.cfg during sdist. + + v58.0.3 ------- diff --git a/setup.cfg b/setup.cfg index fbf82af..fb25e6c 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools -version = 58.0.3 +version = 58.0.4 author = Python Packaging Authority author_email = distutils-sig@python.org description = Easily download, build, install, upgrade, and uninstall Python packages diff --git a/setuptools/command/setopt.py b/setuptools/command/setopt.py index e18057c..6358c04 100644 --- a/setuptools/command/setopt.py +++ b/setuptools/command/setopt.py @@ -39,6 +39,7 @@ def edit_config(filename, settings, dry_run=False): """ log.debug("Reading configuration from %s", filename) opts = configparser.RawConfigParser() + opts.optionxform = lambda x: x opts.read([filename]) for section, options in settings.items(): if options is None: diff --git a/setuptools/tests/test_setopt.py b/setuptools/tests/test_setopt.py index 0163f9a..61dc68b 100644 --- a/setuptools/tests/test_setopt.py +++ b/setuptools/tests/test_setopt.py @@ -28,3 +28,11 @@ class TestEdit: parser = self.parse_config(str(config)) assert parser.get('names', 'jaraco') == 'джарако' assert parser.get('names', 'other') == 'yes' + + def test_case_retained(self, tmpdir): + """ + """ + config = tmpdir.join('setup.cfg') + self.write_text(str(config), '[names]\nJARACO=jaraco') + setopt.edit_config(str(config), dict()) + assert 'JARACO' in config.read_text(encoding='ascii') -- 2.34.1