From ab7c2d58317882f7679b09d1278054727d3f38c6 Mon Sep 17 00:00:00 2001 From: JinWang An Date: Mon, 27 Mar 2023 17:02:32 +0900 Subject: [PATCH] Imported Upstream version 54.1.2 --- .bumpversion.cfg | 2 +- .editorconfig | 15 +++++++ CHANGES.rst | 9 ++++ pytest.ini | 2 - setup.cfg | 67 ++++++++++++++++------------- setuptools/dist.py | 12 +++++- setuptools/tests/test_config.py | 16 +++---- setuptools/tests/test_virtualenv.py | 11 +++-- tox.ini | 2 +- 9 files changed, 88 insertions(+), 48 deletions(-) create mode 100644 .editorconfig diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 1d2c227..2c0c640 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -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 index 0000000..6385b57 --- /dev/null +++ b/.editorconfig @@ -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 diff --git a/CHANGES.rst b/CHANGES.rst index bedd1fa..c8db71e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -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 ------- diff --git a/pytest.ini b/pytest.ini index 03fc773..9aa1b17 100644 --- a/pytest.ini +++ b/pytest.ini @@ -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 diff --git a/setup.cfg b/setup.cfg index 7b05eed..2c4cb02 100644 --- 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] diff --git a/setuptools/dist.py b/setuptools/dist.py index 70c0e6b..7cebcb3 100644 --- a/setuptools/dist.py +++ b/setuptools/dist.py @@ -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 " diff --git a/setuptools/tests/test_config.py b/setuptools/tests/test_config.py index 1ff5ee4..21f1bec 100644 --- a/setuptools/tests/test_config.py +++ b/setuptools/tests/test_config.py @@ -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, diff --git a/setuptools/tests/test_virtualenv.py b/setuptools/tests/test_virtualenv.py index f13f799..9cf6d30 100644 --- a/setuptools/tests/test_virtualenv.py +++ b/setuptools/tests/test_virtualenv.py @@ -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 8ab2b8c..aea213c 100644 --- 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 -- 2.34.1