Browse Source

Intermediate changes

robot-piglet 8 months ago
parent
commit
4df3e22156

+ 1 - 1
contrib/python/hypothesis/py3/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: hypothesis
-Version: 6.104.0
+Version: 6.104.1
 Summary: A library for property-based testing
 Home-page: https://hypothesis.works
 Author: David R. MacIver and Zac Hatfield-Dodds

+ 4 - 5
contrib/python/hypothesis/py3/hypothesis/core.py

@@ -1104,12 +1104,11 @@ class StateForActualGivenExecution:
             if TESTCASE_CALLBACKS:
                 if runner := getattr(self, "_runner", None):
                     phase = runner._current_phase
-                elif (
-                    self.failed_normally or self.failed_due_to_deadline
-                ):  # pragma: no cover  # FIXME
-                    phase = "shrink"
                 else:  # pragma: no cover  # in case of messing with internals
-                    phase = "unknown"
+                    if self.failed_normally or self.failed_due_to_deadline:
+                        phase = "shrink"
+                    else:
+                        phase = "unknown"
                 backend_desc = f", using backend={self.settings.backend!r}" * (
                     self.settings.backend != "hypothesis"
                     and not getattr(runner, "_switch_to_hypothesis_provider", False)

+ 14 - 11
contrib/python/hypothesis/py3/hypothesis/database.py

@@ -225,17 +225,20 @@ class DirectoryBasedExampleDatabase(ExampleDatabase):
         # Note: we attempt to create the dir in question now. We
         # already checked for permissions, but there can still be other issues,
         # e.g. the disk is full, or permissions might have been changed.
-        self._key_path(key).mkdir(exist_ok=True, parents=True)
-        path = self._value_path(key, value)
-        if not path.exists():
-            suffix = binascii.hexlify(os.urandom(16)).decode("ascii")
-            tmpname = path.with_suffix(f"{path.suffix}.{suffix}")
-            tmpname.write_bytes(value)
-            try:
-                tmpname.rename(path)
-            except OSError:  # pragma: no cover
-                tmpname.unlink()
-            assert not tmpname.exists()
+        try:
+            self._key_path(key).mkdir(exist_ok=True, parents=True)
+            path = self._value_path(key, value)
+            if not path.exists():
+                suffix = binascii.hexlify(os.urandom(16)).decode("ascii")
+                tmpname = path.with_suffix(f"{path.suffix}.{suffix}")
+                tmpname.write_bytes(value)
+                try:
+                    tmpname.rename(path)
+                except OSError:  # pragma: no cover
+                    tmpname.unlink()
+                assert not tmpname.exists()
+        except OSError:  # pragma: no cover
+            pass
 
     def move(self, src: bytes, dest: bytes, value: bytes) -> None:
         if src == dest:

+ 1 - 1
contrib/python/hypothesis/py3/hypothesis/internal/entropy.py

@@ -127,7 +127,7 @@ def register_random(r: RandomLike) -> None:
                     "PRNG. See the docs for `register_random` for more "
                     "details."
                 )
-            elif not FREE_THREADED_CPYTHON:  # pragma: no cover  # FIXME
+            elif not FREE_THREADED_CPYTHON:  # pragma: no branch
                 # On CPython, check for the free-threaded build because
                 # gc.get_referrers() ignores objects with immortal refcounts
                 # and objects are immortalized in the Python 3.13

+ 1 - 1
contrib/python/hypothesis/py3/hypothesis/stateful.py

@@ -388,7 +388,7 @@ class RuleBasedStateMachine(metaclass=StateMachineMeta):
         for target in targets:
             name = self._new_name(target)
 
-            def printer(obj, p, cycle, name=name):  # pragma: no cover  # FIXME
+            def printer(obj, p, cycle, name=name):
                 return p.text(name)
 
             self.__printer.singleton_pprinters.setdefault(id(result), printer)

+ 1 - 1
contrib/python/hypothesis/py3/hypothesis/version.py

@@ -8,5 +8,5 @@
 # v. 2.0. If a copy of the MPL was not distributed with this file, You can
 # obtain one at https://mozilla.org/MPL/2.0/.
 
-__version_info__ = (6, 104, 0)
+__version_info__ = (6, 104, 1)
 __version__ = ".".join(map(str, __version_info__))

+ 1 - 1
contrib/python/hypothesis/py3/ya.make

@@ -2,7 +2,7 @@
 
 PY3_LIBRARY()
 
-VERSION(6.104.0)
+VERSION(6.104.1)
 
 LICENSE(MPL-2.0)
 

+ 1 - 1
contrib/python/importlib-metadata/py3/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: importlib_metadata
-Version: 7.2.1
+Version: 8.0.0
 Summary: Read metadata from Python packages
 Author-email: "Jason R. Coombs" <jaraco@jaraco.com>
 Project-URL: Source, https://github.com/python/importlib_metadata

+ 1 - 22
contrib/python/importlib-metadata/py3/importlib_metadata/__init__.py

@@ -11,7 +11,6 @@ import inspect
 import pathlib
 import operator
 import textwrap
-import warnings
 import functools
 import itertools
 import posixpath
@@ -339,27 +338,7 @@ class FileHash:
         return f'<FileHash mode: {self.mode} value: {self.value}>'
 
 
-class DeprecatedNonAbstract:
-    # Required until Python 3.14
-    def __new__(cls, *args, **kwargs):
-        all_names = {
-            name for subclass in inspect.getmro(cls) for name in vars(subclass)
-        }
-        abstract = {
-            name
-            for name in all_names
-            if getattr(getattr(cls, name), '__isabstractmethod__', False)
-        }
-        if abstract:
-            warnings.warn(
-                f"Unimplemented abstract methods {abstract}",
-                DeprecationWarning,
-                stacklevel=2,
-            )
-        return super().__new__(cls)
-
-
-class Distribution(DeprecatedNonAbstract):
+class Distribution(metaclass=abc.ABCMeta):
     """
     An abstract Python distribution package.
 

+ 8 - 15
contrib/python/importlib-metadata/py3/importlib_metadata/_adapters.py

@@ -1,20 +1,8 @@
-import functools
-import warnings
 import re
 import textwrap
 import email.message
 
 from ._text import FoldedCase
-from ._compat import pypy_partial
-
-
-# Do not remove prior to 2024-01-01 or Python 3.14
-_warn = functools.partial(
-    warnings.warn,
-    "Implicit None on return values is deprecated and will raise KeyErrors.",
-    DeprecationWarning,
-    stacklevel=pypy_partial(2),
-)
 
 
 class Message(email.message.Message):
@@ -53,12 +41,17 @@ class Message(email.message.Message):
 
     def __getitem__(self, item):
         """
-        Warn users that a ``KeyError`` can be expected when a
-        missing key is supplied. Ref python/importlib_metadata#371.
+        Override parent behavior to typical dict behavior.
+
+        ``email.message.Message`` will emit None values for missing
+        keys. Typical mappings, including this ``Message``, will raise
+        a key error for missing keys.
+
+        Ref python/importlib_metadata#371.
         """
         res = super().__getitem__(item)
         if res is None:
-            _warn()
+            raise KeyError(item)
         return res
 
     def _repair_headers(self):

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