Imported Upstream version 59.5.0 upstream/59.5.0
authorDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 18 Jul 2022 06:39:04 +0000 (15:39 +0900)
committerDongHun Kwak <dh0128.kwak@samsung.com>
Mon, 18 Jul 2022 06:39:04 +0000 (15:39 +0900)
CHANGES.rst
PKG-INFO
docs/userguide/dependency_management.rst
docs/userguide/quickstart.rst
pkg_resources/__init__.py
setup.cfg
setuptools.egg-info/PKG-INFO
setuptools/_distutils/command/install.py
setuptools/_distutils/tests/test_unixccompiler.py
setuptools/dist.py

index 58f35ed..7d7bfc7 100644 (file)
@@ -1,3 +1,12 @@
+v59.5.0
+-------
+
+
+Changes
+^^^^^^^
+* #2914: Merge with pypa/distutils@8f2df0bf6.
+
+
 v59.4.0
 -------
 
index 7ba0d56..d682f0f 100644 (file)
--- a/PKG-INFO
+++ b/PKG-INFO
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: setuptools
-Version: 59.4.0
+Version: 59.5.0
 Summary: Easily download, build, install, upgrade, and uninstall Python packages
 Home-page: https://github.com/pypa/setuptools
 Author: Python Packaging Authority
index 23578a5..9c29dbd 100644 (file)
@@ -360,6 +360,6 @@ or ``setup.py``.
 
         setup(
             name="Project-B",
-            python_requires=[">=3.6"],
+            python_requires=">=3.6",
             ...,
         )
index 6bf353a..98e34c1 100644 (file)
@@ -159,7 +159,7 @@ When your project is installed, all of the dependencies not already installed
 will be located (via PyPI), downloaded, built (if necessary), and installed.
 This, of course, is a simplified scenarios. ``setuptools`` also provide
 additional keywords such as ``setup_requires`` that allows you to install
-dependencies before running the script, and ``extras_requires`` that take
+dependencies before running the script, and ``extras_require`` that take
 care of those needed by automatically generated scripts. It also provides
 mechanisms to handle dependencies that are not in PyPI. For more advanced use,
 see :doc:`dependency_management`
index 42129d5..955fdc4 100644 (file)
@@ -2396,18 +2396,19 @@ def _set_parent_ns(packageName):
         setattr(sys.modules[parent], name, sys.modules[packageName])
 
 
-def yield_lines(strs):
-    """Yield non-empty/non-comment lines of a string or sequence"""
-    if isinstance(strs, str):
-        for s in strs.splitlines():
-            s = s.strip()
-            # skip blank lines/comments
-            if s and not s.startswith('#'):
-                yield s
-    else:
-        for ss in strs:
-            for s in yield_lines(ss):
-                yield s
+def _nonblank(str):
+    return str and not str.startswith('#')
+
+
+@functools.singledispatch
+def yield_lines(iterable):
+    """Yield valid lines of a string or iterable"""
+    return itertools.chain.from_iterable(map(yield_lines, iterable))
+
+
+@yield_lines.register(str)
+def _(text):
+    return filter(_nonblank, map(str.strip, text.splitlines()))
 
 
 MODULE = re.compile(r"\w+(\.\w+)*$").match
index 05cae4a..0bc0101 100644 (file)
--- a/setup.cfg
+++ b/setup.cfg
@@ -1,6 +1,6 @@
 [metadata]
 name = setuptools
-version = 59.4.0
+version = 59.5.0
 author = Python Packaging Authority
 author_email = distutils-sig@python.org
 description = Easily download, build, install, upgrade, and uninstall Python packages
index 7ba0d56..d682f0f 100644 (file)
@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: setuptools
-Version: 59.4.0
+Version: 59.5.0
 Summary: Easily download, build, install, upgrade, and uninstall Python packages
 Home-page: https://github.com/pypa/setuptools
 Author: Python Packaging Authority
index c756b6d..18b352f 100644 (file)
@@ -471,8 +471,13 @@ class install(Command):
                     raise DistutilsOptionError(
                           "must not supply exec-prefix without prefix")
 
-                self.prefix = os.path.normpath(sys.prefix)
-                self.exec_prefix = os.path.normpath(sys.exec_prefix)
+                # Allow Fedora to add components to the prefix
+                _prefix_addition = getattr(sysconfig, '_prefix_addition', "")
+
+                self.prefix = (
+                    os.path.normpath(sys.prefix) + _prefix_addition)
+                self.exec_prefix = (
+                    os.path.normpath(sys.exec_prefix) + _prefix_addition)
 
             else:
                 if self.exec_prefix is None:
index 63c7dd3..2ea93da 100644 (file)
@@ -11,9 +11,12 @@ from distutils.errors import DistutilsPlatformError
 from distutils.unixccompiler import UnixCCompiler
 from distutils.util import _clear_cached_macosx_ver
 
-class UnixCCompilerTestCase(unittest.TestCase):
+from . import support
+
+class UnixCCompilerTestCase(support.TempdirManager, unittest.TestCase):
 
     def setUp(self):
+        super().setUp()
         self._backup_platform = sys.platform
         self._backup_get_config_var = sysconfig.get_config_var
         self._backup_get_config_vars = sysconfig.get_config_vars
@@ -23,6 +26,7 @@ class UnixCCompilerTestCase(unittest.TestCase):
         self.cc = CompilerWrapper()
 
     def tearDown(self):
+        super().tearDown()
         sys.platform = self._backup_platform
         sysconfig.get_config_var = self._backup_get_config_var
         sysconfig.get_config_vars = self._backup_get_config_vars
@@ -237,6 +241,7 @@ class UnixCCompilerTestCase(unittest.TestCase):
         # ensure that setting output_dir does not raise
         # FileNotFoundError: [Errno 2] No such file or directory: 'a.out'
         self.cc.output_dir = 'scratch'
+        os.chdir(self.mkdtemp())
         self.cc.has_function('abort', includes=['stdlib.h'])
 
 
index fb16886..74afa98 100644 (file)
@@ -145,9 +145,12 @@ def read_pkg_file(self, file):
 
 
 def single_line(val):
-    # quick and dirty validation for description pypa/setuptools#1390
+    """
+    Quick and dirty validation for Summary pypa/setuptools#1390.
+    """
     if '\n' in val:
-        # TODO after 2021-07-31: Replace with `raise ValueError("newlines not allowed")`
+        # TODO: Replace with `raise ValueError("newlines not allowed")`
+        # after reviewing #2893.
         warnings.warn("newlines not allowed and will break in the future")
         val = val.strip().split('\n')[0]
     return val