From 45f3c212bcc34bbea1758806fcfd900da1d3939d 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.3.0 --- .bumpversion.cfg | 2 +- .codecov.yml | 4 +++ CHANGES.rst | 19 ++++++++++++ changelog.d/1988-change.rst | 2 -- changelog.d/2785-change.rst | 2 -- docs/userguide/declarative_config.rst | 6 ++-- docs/userguide/distribution.rst | 2 +- pytest.ini | 29 ++++++++++++------- setup.cfg | 2 +- setuptools/__init__.py | 6 ++++ .../_distutils/tests/test_unixccompiler.py | 4 +-- setuptools/_distutils/unixccompiler.py | 25 ++++++---------- setuptools/_distutils/util.py | 4 +-- setuptools/command/easy_install.py | 6 ++++ setuptools/command/install.py | 7 +++++ setuptools/tests/test_virtualenv.py | 5 ++-- 16 files changed, 82 insertions(+), 43 deletions(-) delete mode 100644 changelog.d/1988-change.rst delete mode 100644 changelog.d/2785-change.rst diff --git a/.bumpversion.cfg b/.bumpversion.cfg index 0ed3563..5779356 100644 --- a/.bumpversion.cfg +++ b/.bumpversion.cfg @@ -1,5 +1,5 @@ [bumpversion] -current_version = 58.2.0 +current_version = 58.3.0 commit = True tag = True diff --git a/.codecov.yml b/.codecov.yml index 69cb760..7510dfc 100644 --- a/.codecov.yml +++ b/.codecov.yml @@ -1 +1,5 @@ comment: false +coverage: + status: + project: + threshold: 0.5% diff --git a/CHANGES.rst b/CHANGES.rst index 0a002fe..c8ecd1e 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -1,3 +1,22 @@ +v58.3.0 +------- + + +Changes +^^^^^^^ +* #917: ``setup.py install`` and ``easy_install`` commands are now officially deprecated. Use other standards-based installers (like pip) and builders (like build). Workloads reliant on this behavior should pin to this major version of Setuptools. +* #1988: Deprecated the ``bdist_rpm`` command. Binary packages should be built as wheels instead. + -- by :user:`hugovk` +* #2785: Replace confirparser's readfp with read_file, deprecated since Python 3.2. + -- by :user:`hugovk` +* #2823: Officially deprecated support for ``setup_requires``. Users are encouraged instead to migrate to PEP 518 ``build-system.requires`` in ``pyproject.toml``. Users reliant on ``setup_requires`` should consider pinning to this major version to avoid disruption. + +Misc +^^^^ +* #2762: Changed codecov.yml to configure the threshold to be lower + -- by :user:`tanvimoharir` + + v58.2.0 ------- diff --git a/changelog.d/1988-change.rst b/changelog.d/1988-change.rst deleted file mode 100644 index 4f10463..0000000 --- a/changelog.d/1988-change.rst +++ /dev/null @@ -1,2 +0,0 @@ -Deprecated the ``bdist_rpm`` command. Binary packages should be built as wheels instead. --- by :user:`hugovk` diff --git a/changelog.d/2785-change.rst b/changelog.d/2785-change.rst deleted file mode 100644 index 7e9631b..0000000 --- a/changelog.d/2785-change.rst +++ /dev/null @@ -1,2 +0,0 @@ -Replace confirparser's readfp with read_file, deprecated since Python 3.2. --- by :user:`hugovk` diff --git a/docs/userguide/declarative_config.rst b/docs/userguide/declarative_config.rst index c50fcf6..abafe37 100644 --- a/docs/userguide/declarative_config.rst +++ b/docs/userguide/declarative_config.rst @@ -206,10 +206,10 @@ Options Key Type Minimum Version Notes ======================= =================================== =============== ========= zip_safe bool -setup_requires list-semi +setup_requires list-semi 36.7.0 install_requires list-semi extras_require section [#opt-2]_ -python_requires str +python_requires str 34.4.0 entry_points file:, section 51.0.0 scripts list-comma eager_resources list-comma @@ -221,7 +221,7 @@ package_dir dict package_data section [#opt-1]_ exclude_package_data section namespace_packages list-comma -py_modules list-comma +py_modules list-comma 34.4.0 data_files dict 40.6.0 ======================= =================================== =============== ========= diff --git a/docs/userguide/distribution.rst b/docs/userguide/distribution.rst index 19bed1f..2872dac 100644 --- a/docs/userguide/distribution.rst +++ b/docs/userguide/distribution.rst @@ -25,7 +25,7 @@ the command line ahead of the ``sdist`` or ``bdist`` commands that you want to generate a daily build or snapshot for. See the section below on the :ref:`egg_info ` command for more details. -(Also, before you release your project, be sure to see the section above on +(Also, before you release your project, be sure to see the section on :ref:`Specifying Your Project's Version` for more information about how pre- and post-release tags affect how version numbers are interpreted. This is important in order to make sure that dependency processing tools will know diff --git a/pytest.ini b/pytest.ini index eebb212..c7b62cc 100644 --- a/pytest.ini +++ b/pytest.ini @@ -8,21 +8,28 @@ doctest_optionflags=ALLOW_UNICODE ELLIPSIS # workaround for warning pytest-dev/pytest#6178 junit_family=xunit2 filterwarnings= - # Fail on warnings - error + # Fail on warnings + error - ## upstream + ## upstream # Suppress deprecation warning in flake8 ignore:SelectableGroups dict interface is deprecated::flake8 # Suppress deprecation warning in pypa/packaging#433 ignore:The distutils package is deprecated::packaging.tags ## end upstream - # https://github.com/pypa/setuptools/issues/1823 - ignore:bdist_wininst command is deprecated - # Suppress this error; unimportant for CI tests - ignore:Extraction path is writable by group/others:UserWarning - # Suppress weird RuntimeWarning. - ignore:Parent module 'setuptools' not found while handling absolute import:RuntimeWarning - # Suppress use of bytes for filenames on Windows until fixed #2016 - ignore:The Windows bytes API has been deprecated:DeprecationWarning + # https://github.com/pypa/setuptools/issues/1823 + ignore:bdist_wininst command is deprecated + # Suppress this error; unimportant for CI tests + ignore:Extraction path is writable by group/others:UserWarning + # Suppress weird RuntimeWarning. + ignore:Parent module 'setuptools' not found while handling absolute import:RuntimeWarning + # Suppress use of bytes for filenames on Windows until fixed #2016 + ignore:The Windows bytes API has been deprecated:DeprecationWarning + + # https://github.com/pypa/setuptools/issues/2823 + ignore:setup_requires is deprecated. + + # https://github.com/pypa/setuptools/issues/917 + ignore:setup.py install is deprecated. + ignore:easy_install command is deprecated. diff --git a/setup.cfg b/setup.cfg index d7236be..65c9479 100644 --- a/setup.cfg +++ b/setup.cfg @@ -1,6 +1,6 @@ [metadata] name = setuptools -version = 58.2.0 +version = 58.3.0 author = Python Packaging Authority author_email = distutils-sig@python.org description = Easily download, build, install, upgrade, and uninstall Python packages diff --git a/setuptools/__init__.py b/setuptools/__init__.py index 9d6f0bc..a623262 100644 --- a/setuptools/__init__.py +++ b/setuptools/__init__.py @@ -4,6 +4,7 @@ from fnmatch import fnmatchcase import functools import os import re +import warnings import _distutils_hack.override # noqa: F401 @@ -144,6 +145,11 @@ def _install_setup_requires(attrs): # Honor setup.cfg's options. dist.parse_config_files(ignore_option_errors=True) if dist.setup_requires: + warnings.warn( + "setup_requires is deprecated. Supply build " + "dependencies using PEP 517 pyproject.toml build-requires.", + SetuptoolsDeprecationWarning, + ) dist.fetch_build_eggs(dist.setup_requires) diff --git a/setuptools/_distutils/tests/test_unixccompiler.py b/setuptools/_distutils/tests/test_unixccompiler.py index 1008f58..ee2fe99 100644 --- a/setuptools/_distutils/tests/test_unixccompiler.py +++ b/setuptools/_distutils/tests/test_unixccompiler.py @@ -177,7 +177,7 @@ class UnixCCompilerTestCase(unittest.TestCase): elif v == 'GNULD': return 'yes' sysconfig.get_config_var = gcv - self.assertEqual(self.cc.rpath_foo(), '-R/foo') + self.assertEqual(self.cc.rpath_foo(), '-Wl,--enable-new-dtags,-R/foo') # non-GCC non-GNULD sys.platform = 'bar' @@ -187,7 +187,7 @@ class UnixCCompilerTestCase(unittest.TestCase): elif v == 'GNULD': return 'no' sysconfig.get_config_var = gcv - self.assertEqual(self.cc.rpath_foo(), '-R/foo') + self.assertEqual(self.cc.rpath_foo(), '-Wl,-R/foo') @unittest.skipIf(sys.platform == 'win32', "can't test on Windows") def test_cc_overrides_ldshared(self): diff --git a/setuptools/_distutils/unixccompiler.py b/setuptools/_distutils/unixccompiler.py index 349cc16..a07e598 100644 --- a/setuptools/_distutils/unixccompiler.py +++ b/setuptools/_distutils/unixccompiler.py @@ -245,23 +245,16 @@ class UnixCCompiler(CCompiler): if self._is_gcc(compiler): return ["-Wl,+s", "-L" + dir] return ["+s", "-L" + dir] + + # For all compilers, `-Wl` is the presumed way to + # pass a compiler option to the linker and `-R` is + # the way to pass an RPATH. + if sysconfig.get_config_var("GNULD") == "yes": + # GNU ld needs an extra option to get a RUNPATH + # instead of just an RPATH. + return "-Wl,--enable-new-dtags,-R" + dir else: - if self._is_gcc(compiler): - # gcc on non-GNU systems does not need -Wl, but can - # use it anyway. Since distutils has always passed in - # -Wl whenever gcc was used in the past it is probably - # safest to keep doing so. - if sysconfig.get_config_var("GNULD") == "yes": - # GNU ld needs an extra option to get a RUNPATH - # instead of just an RPATH. - return "-Wl,--enable-new-dtags,-R" + dir - else: - return "-Wl,-R" + dir - else: - # No idea how --enable-new-dtags would be passed on to - # ld if this system was using GNU ld. Don't know if a - # system like this even exists. - return "-R" + dir + return "-Wl,-R" + dir def library_option(self, lib): return "-l" + lib diff --git a/setuptools/_distutils/util.py b/setuptools/_distutils/util.py index 64f06dd..afc23c4 100644 --- a/setuptools/_distutils/util.py +++ b/setuptools/_distutils/util.py @@ -134,14 +134,14 @@ def get_macosx_target_ver(): """Return the version of macOS for which we are building. The target version defaults to the version in sysconfig latched at time - the Python interpreter was built, unless overriden by an environment + the Python interpreter was built, unless overridden by an environment variable. If neither source has a value, then None is returned""" syscfg_ver = get_macosx_target_ver_from_syscfg() env_ver = os.environ.get(MACOSX_VERSION_VAR) if env_ver: - # Validate overriden version against sysconfig version, if have both. + # Validate overridden version against sysconfig version, if have both. # Ensure that the deployment target of the build process is not less # than 10.3 if the interpreter was built for 10.3 or later. This # ensures extension modules are built with correct compatibility diff --git a/setuptools/command/easy_install.py b/setuptools/command/easy_install.py index b88c3e9..1aed0e8 100644 --- a/setuptools/command/easy_install.py +++ b/setuptools/command/easy_install.py @@ -153,6 +153,12 @@ class easy_install(Command): create_index = PackageIndex def initialize_options(self): + warnings.warn( + "easy_install command is deprecated. " + "Use build and pip and other standards-based tools.", + EasyInstallDeprecationWarning, + ) + # the --user option seems to be an opt-in one, # so the default should be False. self.user = 0 diff --git a/setuptools/command/install.py b/setuptools/command/install.py index 72b9a3e..35e54d2 100644 --- a/setuptools/command/install.py +++ b/setuptools/command/install.py @@ -30,6 +30,13 @@ class install(orig.install): _nc = dict(new_commands) def initialize_options(self): + + warnings.warn( + "setup.py install is deprecated. " + "Use build and pip and other standards-based tools.", + setuptools.SetuptoolsDeprecationWarning, + ) + orig.install.initialize_options(self) self.old_and_unmanageable = None self.single_version_externally_managed = None diff --git a/setuptools/tests/test_virtualenv.py b/setuptools/tests/test_virtualenv.py index 399dbaf..462e20c 100644 --- a/setuptools/tests/test_virtualenv.py +++ b/setuptools/tests/test_virtualenv.py @@ -45,7 +45,8 @@ def test_clean_env_install(bare_virtualenv, tmp_src): """ Check setuptools can be installed in a clean environment. """ - bare_virtualenv.run(['python', 'setup.py', 'install'], cd=tmp_src) + cmd = [bare_virtualenv.python, 'setup.py', 'install'] + bare_virtualenv.run(cmd, cd=tmp_src) def _get_pip_versions(): @@ -203,5 +204,5 @@ def test_no_missing_dependencies(bare_virtualenv, request): Quick and dirty test to ensure all external dependencies are vendored. """ for command in ('upload',): # sorted(distutils.command.__all__): - cmd = ['python', 'setup.py', command, '-h'] + cmd = [bare_virtualenv.python, 'setup.py', command, '-h'] bare_virtualenv.run(cmd, cd=request.config.rootdir) -- 2.34.1