Imported Upstream version 54.1.2 upstream/54.1.2
authorJinWang An <jinwang.an@samsung.com>
Mon, 27 Mar 2023 08:02:32 +0000 (17:02 +0900)
committerJinWang An <jinwang.an@samsung.com>
Mon, 27 Mar 2023 08:02:32 +0000 (17:02 +0900)
.bumpversion.cfg
.editorconfig [new file with mode: 0644]
CHANGES.rst
pytest.ini
setup.cfg
setuptools/dist.py
setuptools/tests/test_config.py
setuptools/tests/test_virtualenv.py
tox.ini

index 1d2c227839163027e2b2b6c2ccb74c37370716fc..2c0c640ec07f933e2893b5d3930e7389dcbb4176 100644 (file)
@@ -1,5 +1,5 @@
 [bumpversion]
-current_version = 54.1.1
+current_version = 54.1.2
 commit = True
 tag = True
 
diff --git a/.editorconfig b/.editorconfig
new file mode 100644 (file)
index 0000000..6385b57
--- /dev/null
@@ -0,0 +1,15 @@
+root = true
+
+[*]
+charset = utf-8
+indent_style = tab
+indent_size = 4
+insert_final_newline = true
+end_of_line = lf
+
+[*.py]
+indent_style = space
+
+[*.{yml,yaml}]
+indent_style = space
+indent_size = 2
index bedd1faa017f013753a09d7a87c0eb53c68c2f86..c8db71ee59d464921b1c9f0d87d700eb0b16b9a6 100644 (file)
@@ -1,3 +1,12 @@
+v54.1.2
+-------
+
+
+Misc
+^^^^
+* #2595: Reduced scope of dash deprecation warning to Setuptools/distutils only -- by :user:`melissa-kun-li`
+
+
 v54.1.1
 -------
 
index 03fc773cf479fcc8142a13a5fa7569dfd8a0a87a..9aa1b17347d69d59cda736d0b588f9735274c37a 100644 (file)
@@ -8,8 +8,6 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS
 # workaround for warning pytest-dev/pytest#6178
 junit_family=xunit2
 filterwarnings=
-    # https://github.com/pytest-dev/pytest/issues/6928
-    ignore:direct construction of .*Item has been deprecated:DeprecationWarning
     # Fail on warnings
     error
     # https://github.com/pypa/setuptools/issues/1823
index 7b05eed32f1ce5a33cf27155df935be0a32367f6..2c4cb02fbb9e1df51e7a67947ec451fbab6a1048 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,8 +1,8 @@
 [metadata]
 license_files =
-    LICENSE
+       LICENSE
 name = setuptools
-version = 54.1.1
+version = 54.1.2
 author = Python Packaging Authority
 author_email = distutils-sig@python.org
 description = Easily download, build, install, upgrade, and uninstall Python packages
@@ -14,13 +14,13 @@ classifiers =
        License :: OSI Approved :: MIT License
        Programming Language :: Python :: 3
        Programming Language :: Python :: 3 :: Only
-    Topic :: Software Development :: Libraries :: Python Modules
-    Topic :: System :: Archiving :: Packaging
-    Topic :: System :: Systems Administration
-    Topic :: Utilities
+       Topic :: Software Development :: Libraries :: Python Modules
+       Topic :: System :: Archiving :: Packaging
+       Topic :: System :: Systems Administration
+       Topic :: Utilities
 keywords = CPAN PyPI distutils eggs package management
 project_urls =
-    Documentation = https://setuptools.readthedocs.io/
+       Documentation = https://setuptools.readthedocs.io/
 
 [options]
 packages = find_namespace:
@@ -31,52 +31,57 @@ install_requires =
 
 [options.packages.find]
 exclude =
-        build*
-        docs*
-        tests*
-        *.tests
-        tools*
+       build*
+       dist*
+       docs*
+       tests*
+       *.tests
+       tools*
 
 [options.extras_require]
 testing =
        # upstream
-       pytest >= 3.5, !=3.7.3
+       pytest >= 4.6
        pytest-checkdocs >= 2.4
        pytest-flake8
-       pytest-black >= 0.3.7; python_implementation != "PyPy"
+       # python_implementation: workaround for jaraco/skeleton#22
+       # python_version: workaround for python/typed_ast#156
+       pytest-black >= 0.3.7; python_implementation != "PyPy" and python_version < "3.10"
        pytest-cov
-       pytest-mypy; python_implementation != "PyPy"
+       # python_implementation: workaround for jaraco/skeleton#22
+       # python_version: workaround for python/typed_ast#156
+       pytest-mypy; python_implementation != "PyPy" and python_version < "3.10"
        pytest-enabler >= 1.0.1
 
        # local
-    mock
-    flake8-2020
-    virtualenv>=13.0.0
-    pytest-virtualenv>=1.2.7
-    wheel
-    paver
-    pip>=19.1 # For proper file:// URLs support.
-    jaraco.envs
-    pytest-xdist
-    sphinx
-    jaraco.path>=3.2.0
+       mock
+       flake8-2020
+       virtualenv>=13.0.0
+       pytest-virtualenv>=1.2.7
+       wheel
+       paver
+       pip>=19.1 # For proper file:// URLs support.
+       jaraco.envs
+       pytest-xdist
+       sphinx
+       jaraco.path>=3.2.0
 
 docs =
-    # Keep these in sync with docs/requirements.txt
+       # Keep these in sync with docs/requirements.txt
        # upstream
        sphinx
        jaraco.packaging >= 8.2
        rst.linker >= 1.9
-    sphinx-inline-tabs
+       sphinx-inline-tabs
 
        # local
-    pygments-github-lexers==0.0.5
+       pygments-github-lexers==0.0.5
 
 ssl =
-    wincertstore==0.2; sys_platform=='win32'
+       wincertstore==0.2; sys_platform=='win32'
 
 certs =
-    certifi==2016.9.26
+       certifi==2016.9.26
 
 [options.entry_points]
 
index 70c0e6becb825f9577c04f979029d93b5bf9c630..7cebcb37f481bcca15674d5a0a223d7d60053a4a 100644 (file)
@@ -11,6 +11,7 @@ import distutils.log
 import distutils.core
 import distutils.cmd
 import distutils.dist
+import distutils.command
 from distutils.util import strtobool
 from distutils.debug import DEBUG
 from distutils.fancy_getopt import translate_longopt
@@ -29,6 +30,7 @@ from setuptools.extern import ordered_set
 from . import SetuptoolsDeprecationWarning
 
 import setuptools
+import setuptools.command
 from setuptools import windows_support
 from setuptools.monkey import get_unpatched
 from setuptools.config import parse_configuration
@@ -598,7 +600,7 @@ class Distribution(_Distribution):
                         continue
 
                     val = parser.get(section, opt)
-                    opt = self.dash_to_underscore_warning(opt, section)
+                    opt = self.warn_dash_deprecation(opt, section)
                     opt = self.make_option_lowercase(opt, section)
                     opt_dict[opt] = (filename, val)
 
@@ -624,12 +626,18 @@ class Distribution(_Distribution):
             except ValueError as e:
                 raise DistutilsOptionError(e) from e
 
-    def dash_to_underscore_warning(self, opt, section):
+    def warn_dash_deprecation(self, opt, section):
         if section in (
             'options.extras_require', 'options.data_files',
         ):
             return opt
+
         underscore_opt = opt.replace('-', '_')
+        commands = distutils.command.__all__ + setuptools.command.__all__
+        if (not section.startswith('options') and section != 'metadata'
+                and section not in commands):
+            return underscore_opt
+
         if '-' in opt:
             warnings.warn(
                 "Usage of dash-separated '%s' will not be supported in future "
index 1ff5ee41859a80b059a107bdf2060fb064ad7cc4..21f1becd499bab01e2671c78e525882444c24922 100644 (file)
@@ -507,10 +507,9 @@ class TestMetadata:
             with get_dist(tmpdir):
                 pass
 
-    def test_dash_to_underscore_warning(self, tmpdir):
-        # dash_to_underscore_warning() is a method in setuptools.dist
-        # remove this test and method when dash convert to underscore in setup.cfg
-        # is no longer supported
+    def test_warn_dash_deprecation(self, tmpdir):
+        # warn_dash_deprecation() is a method in setuptools.dist
+        # remove this test and the method when no longer needed
         fake_env(
             tmpdir,
             '[metadata]\n'
@@ -523,11 +522,12 @@ class TestMetadata:
         with pytest.warns(UserWarning, match=msg):
             with get_dist(tmpdir) as dist:
                 metadata = dist.metadata
-                assert metadata.author_email == 'test@test.com'
-                assert metadata.maintainer_email == 'foo@foo.com'
 
-    def test_uppercase_warning(self, tmpdir):
-        # remove this test and the method uppercase_warning() in setuptools.dist
+        assert metadata.author_email == 'test@test.com'
+        assert metadata.maintainer_email == 'foo@foo.com'
+
+    def test_make_option_lowercase(self, tmpdir):
+        # remove this test and the method make_option_lowercase() in setuptools.dist
         # when no longer needed
         fake_env(
             tmpdir,
index f13f7997e3df69df83948ee32fd6da8cfd799eac..9cf6d30f7dd6c219bc356ddf05c8c44c432cf71b 100644 (file)
@@ -74,10 +74,15 @@ def _get_pip_versions():
     def skip_network(param):
         return param if network else mark(param, pytest.mark.skip(reason="no network"))
 
+    issue2599 = pytest.mark.skipif(
+        sys.version_info > (3, 10),
+        reason="pypa/setuptools#2599",
+    )
+
     network_versions = [
-        'pip==9.0.3',
-        'pip==10.0.1',
-        'pip==18.1',
+        mark('pip==9.0.3', issue2599),
+        mark('pip==10.0.1', issue2599),
+        mark('pip==18.1', issue2599),
         mark('pip==19.3.1', pytest.mark.xfail(reason='pypa/pip#6599')),
         'pip==20.0.2',
         'https://github.com/pypa/pip/archive/master.zip',
diff --git a/tox.ini b/tox.ini
index 8ab2b8cf02fe61f23568ef2881aa4e26d45cfc47..aea213c4ecdaa56201fe5a504cd83b836d096357 100644 (file)
--- a/tox.ini
+++ b/tox.ini
@@ -53,7 +53,7 @@ commands =
 skip_install = True
 deps =
        build
-       twine[keyring]>=1.13
+       twine>=3
        path
        jaraco.develop>=7.1
        jaraco.tidelift