+v59.5.0
+-------
+
+
+Changes
+^^^^^^^
+* #2914: Merge with pypa/distutils@8f2df0bf6.
+
+
v59.4.0
-------
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
setup(
name="Project-B",
- python_requires=[">=3.6"],
+ python_requires=">=3.6",
...,
)
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`
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
[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
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
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:
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
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
# 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'])
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