Browse Source

Update contrib/python/setuptools/py3 to 69.0.0

robot-contrib 1 year ago
parent
commit
e69e63ed81

+ 2 - 2
contrib/python/setuptools/py3/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: setuptools
-Version: 68.2.2
+Version: 69.0.0
 Summary: Easily download, build, install, upgrade, and uninstall Python packages
 Home-page: https://github.com/pypa/setuptools
 Author: Python Packaging Authority
@@ -22,6 +22,7 @@ License-File: LICENSE
 Provides-Extra: certs
 Provides-Extra: docs
 Requires-Dist: sphinx >=3.5 ; extra == 'docs'
+Requires-Dist: sphinx <7.2.5 ; extra == 'docs'
 Requires-Dist: jaraco.packaging >=9.3 ; extra == 'docs'
 Requires-Dist: rst.linker >=1.9 ; extra == 'docs'
 Requires-Dist: furo ; extra == 'docs'
@@ -33,7 +34,6 @@ Requires-Dist: sphinx-inline-tabs ; extra == 'docs'
 Requires-Dist: sphinx-reredirects ; extra == 'docs'
 Requires-Dist: sphinxcontrib-towncrier ; extra == 'docs'
 Requires-Dist: sphinx-notfound-page <2,>=1 ; extra == 'docs'
-Requires-Dist: sphinx-hoverxref <2 ; extra == 'docs'
 Provides-Extra: ssl
 Provides-Extra: testing
 Requires-Dist: pytest >=6 ; extra == 'testing'

+ 6 - 9
contrib/python/setuptools/py3/pkg_resources/__init__.py

@@ -1874,7 +1874,7 @@ class ZipProvider(EggProvider):
         timestamp, size = self._get_date_and_size(self.zipinfo[zip_path])
 
         if not WRITE_SUPPORT:
-            raise IOError(
+            raise OSError(
                 '"os.rename" and "os.unlink" are not supported ' 'on this platform'
             )
         try:
@@ -2001,7 +2001,7 @@ class FileMetadata(EmptyProvider):
         if name != 'PKG-INFO':
             raise KeyError("No metadata except PKG-INFO is available")
 
-        with io.open(self.path, encoding='utf-8', errors="replace") as f:
+        with open(self.path, encoding='utf-8', errors="replace") as f:
             metadata = f.read()
         self._warn_on_replacement(metadata)
         return metadata
@@ -2095,8 +2095,7 @@ def find_eggs_in_zip(importer, path_item, only=False):
         if _is_egg_path(subitem):
             subpath = os.path.join(path_item, subitem)
             dists = find_eggs_in_zip(zipimport.zipimporter(subpath), subpath)
-            for dist in dists:
-                yield dist
+            yield from dists
         elif subitem.lower().endswith(('.dist-info', '.egg-info')):
             subpath = os.path.join(path_item, subitem)
             submeta = EggMetadata(zipimport.zipimporter(subpath))
@@ -2131,8 +2130,7 @@ def find_on_path(importer, path_item, only=False):
     for entry in sorted(entries):
         fullpath = os.path.join(path_item, entry)
         factory = dist_factory(path_item, entry, only)
-        for dist in factory(fullpath):
-            yield dist
+        yield from factory(fullpath)
 
 
 def dist_factory(path_item, entry, only):
@@ -2850,8 +2848,7 @@ class Distribution:
 
     def _get_metadata(self, name):
         if self.has_metadata(name):
-            for line in self.get_metadata_lines(name):
-                yield line
+            yield from self.get_metadata_lines(name)
 
     def _get_version(self):
         lines = self._get_metadata(self.PKG_INFO)
@@ -3243,7 +3240,7 @@ def ensure_directory(path):
 def _bypass_ensure_directory(path):
     """Sandbox-bypassing version of ensure_directory()"""
     if not WRITE_SUPPORT:
-        raise IOError('"os.mkdir" not supported on this platform.')
+        raise OSError('"os.mkdir" not supported on this platform.')
     dirname, filename = split(path)
     if dirname and filename and not isdir(dirname):
         _bypass_ensure_directory(dirname)

+ 0 - 0
contrib/python/setuptools/py3/pkg_resources/_vendor/importlib_resources/py.typed


+ 0 - 0
contrib/python/setuptools/py3/pkg_resources/_vendor/more_itertools/py.typed


+ 0 - 0
contrib/python/setuptools/py3/pkg_resources/_vendor/packaging/py.typed


+ 0 - 0
contrib/python/setuptools/py3/pkg_resources/_vendor/platformdirs/py.typed


+ 53 - 0
contrib/python/setuptools/py3/setuptools/_distutils/_functools.py

@@ -1,3 +1,4 @@
+import collections.abc
 import functools
 
 
@@ -18,3 +19,55 @@ def pass_none(func):
             return func(param, *args, **kwargs)
 
     return wrapper
+
+
+# from jaraco.functools 4.0
+@functools.singledispatch
+def _splat_inner(args, func):
+    """Splat args to func."""
+    return func(*args)
+
+
+@_splat_inner.register
+def _(args: collections.abc.Mapping, func):
+    """Splat kargs to func as kwargs."""
+    return func(**args)
+
+
+def splat(func):
+    """
+    Wrap func to expect its parameters to be passed positionally in a tuple.
+
+    Has a similar effect to that of ``itertools.starmap`` over
+    simple ``map``.
+
+    >>> import itertools, operator
+    >>> pairs = [(-1, 1), (0, 2)]
+    >>> _ = tuple(itertools.starmap(print, pairs))
+    -1 1
+    0 2
+    >>> _ = tuple(map(splat(print), pairs))
+    -1 1
+    0 2
+
+    The approach generalizes to other iterators that don't have a "star"
+    equivalent, such as a "starfilter".
+
+    >>> list(filter(splat(operator.add), pairs))
+    [(0, 2)]
+
+    Splat also accepts a mapping argument.
+
+    >>> def is_nice(msg, code):
+    ...     return "smile" in msg or code == 0
+    >>> msgs = [
+    ...     dict(msg='smile!', code=20),
+    ...     dict(msg='error :(', code=1),
+    ...     dict(msg='unknown', code=0),
+    ... ]
+    >>> for msg in filter(splat(is_nice), msgs):
+    ...     print(msg)
+    {'msg': 'smile!', 'code': 20}
+    {'msg': 'unknown', 'code': 0}
+    """
+    return functools.wraps(func)(functools.partial(_splat_inner, func=func))

+ 72 - 0
contrib/python/setuptools/py3/setuptools/_distutils/_modified.py

@@ -0,0 +1,72 @@
+"""Timestamp comparison of files and groups of files."""
+
+import functools
+import os.path
+
+from .errors import DistutilsFileError
+from .py39compat import zip_strict
+from ._functools import splat
+
+
+def _newer(source, target):
+    return not os.path.exists(target) or (
+        os.path.getmtime(source) > os.path.getmtime(target)
+    )
+
+
+def newer(source, target):
+    """
+    Is source modified more recently than target.
+
+    Returns True if 'source' is modified more recently than
+    'target' or if 'target' does not exist.
+
+    Raises DistutilsFileError if 'source' does not exist.
+    """
+    if not os.path.exists(source):
+        raise DistutilsFileError("file '%s' does not exist" % os.path.abspath(source))
+
+    return _newer(source, target)
+
+
+def newer_pairwise(sources, targets, newer=newer):
+    """
+    Filter filenames where sources are newer than targets.
+
+    Walk two filename iterables in parallel, testing if each source is newer
+    than its corresponding target.  Returns a pair of lists (sources,
+    targets) where source is newer than target, according to the semantics
+    of 'newer()'.
+    """
+    newer_pairs = filter(splat(newer), zip_strict(sources, targets))
+    return tuple(map(list, zip(*newer_pairs))) or ([], [])
+
+
+def newer_group(sources, target, missing='error'):
+    """
+    Is target out-of-date with respect to any file in sources.
+
+    Return True if 'target' is out-of-date with respect to any file
+    listed in 'sources'. In other words, if 'target' exists and is newer
+    than every file in 'sources', return False; otherwise return True.
+    ``missing`` controls how to handle a missing source file:
+
+    - error (default): allow the ``stat()`` call to fail.
+    - ignore: silently disregard any missing source files.
+    - newer: treat missing source files as "target out of date". This
+      mode is handy in "dry-run" mode: it will pretend to carry out
+      commands that wouldn't work because inputs are missing, but
+      that doesn't matter because dry-run won't run the commands.
+    """
+
+    def missing_as_newer(source):
+        return missing == 'newer' and not os.path.exists(source)
+
+    ignored = os.path.exists if missing == 'ignore' else None
+    return any(
+        missing_as_newer(source) or _newer(source, target)
+        for source in filter(ignored, sources)
+    )
+
+
+newer_pairwise_group = functools.partial(newer_pairwise, newer=newer_group)

+ 1 - 1
contrib/python/setuptools/py3/setuptools/_distutils/bcppcompiler.py

@@ -24,7 +24,7 @@ from .errors import (
 )
 from .ccompiler import CCompiler, gen_preprocess_options
 from .file_util import write_file
-from .dep_util import newer
+from ._modified import newer
 from ._log import log
 
 

+ 1 - 1
contrib/python/setuptools/py3/setuptools/_distutils/ccompiler.py

@@ -18,7 +18,7 @@ from .errors import (
 from .spawn import spawn
 from .file_util import move_file
 from .dir_util import mkpath
-from .dep_util import newer_group
+from ._modified import newer_group
 from .util import split_quoted, execute
 from ._log import log
 

Some files were not shown because too many files changed in this diff