Browse Source

Intermediate changes

robot-piglet 7 months ago
parent
commit
257897ca64

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

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

+ 9 - 3
contrib/python/hypothesis/py3/hypothesis/internal/conjecture/data.py

@@ -2083,11 +2083,17 @@ class ConjectureData:
             assert len(weights) == width
 
         if forced is not None and (min_value is None or max_value is None):
-            # We draw `forced=forced - shrink_towards` here internally. If that
-            # grows larger than a 128 bit signed integer, we can't represent it.
+            # We draw `forced=forced - shrink_towards` here internally, after clamping.
+            # If that grows larger than a 128 bit signed integer, we can't represent it.
             # Disallow this combination for now.
             # Note that bit_length() = 128 -> signed bit size = 129.
-            assert (forced - shrink_towards).bit_length() < 128
+            _shrink_towards = shrink_towards
+            if min_value is not None:
+                _shrink_towards = max(min_value, _shrink_towards)
+            if max_value is not None:
+                _shrink_towards = min(max_value, _shrink_towards)
+
+            assert (forced - _shrink_towards).bit_length() < 128
         if forced is not None and min_value is not None:
             assert min_value <= forced
         if forced is not None and max_value is not None:

+ 8 - 12
contrib/python/hypothesis/py3/hypothesis/internal/conjecture/datatree.py

@@ -285,22 +285,18 @@ def all_children(ir_type, kwargs):
                         continue
                     yield n
         else:
-            # hard case: only one bound was specified. Here we probe either upwards
-            # or downwards with our full 128 bit generation, but only half of these
-            # (plus one for the case of generating zero) result in a probe in the
-            # direction we want. ((2**128 - 1) // 2) + 1 == a range of 2 ** 127.
-            #
-            # strictly speaking, I think this is not actually true: if
-            # max_value > shrink_towards then our range is ((-2**127) + 1, max_value),
-            # and it only narrows when max_value < shrink_towards. But it
-            # really doesn't matter for this case because (even half) unbounded
-            # integers generation is hit extremely rarely.
             assert (min_value is None) ^ (max_value is None)
+            # hard case: only one bound was specified. Here we probe in 128 bits
+            # around shrink_towards, and discard those above max_value or below
+            # min_value respectively.
+            shrink_towards = kwargs["shrink_towards"]
             if min_value is None:
-                yield from range(max_value - (2**127) + 1, max_value)
+                shrink_towards = min(max_value, shrink_towards)
+                yield from range(shrink_towards - (2**127) + 1, max_value)
             else:
                 assert max_value is None
-                yield from range(min_value, min_value + (2**127) - 1)
+                shrink_towards = max(min_value, shrink_towards)
+                yield from range(min_value, shrink_towards + (2**127) - 1)
 
     if ir_type == "boolean":
         p = kwargs["p"]

+ 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, 108, 4)
+__version_info__ = (6, 108, 5)
 __version__ = ".".join(map(str, __version_info__))

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

@@ -2,7 +2,7 @@
 
 PY3_LIBRARY()
 
-VERSION(6.108.4)
+VERSION(6.108.5)
 
 LICENSE(MPL-2.0)
 

+ 1 - 1
contrib/python/pip/.dist-info/METADATA

@@ -1,6 +1,6 @@
 Metadata-Version: 2.1
 Name: pip
-Version: 24.1.2
+Version: 24.2
 Summary: The PyPA recommended tool for installing Python packages.
 Author-email: The pip developers <distutils-sig@python.org>
 License: MIT

+ 11 - 0
contrib/python/pip/AUTHORS.txt

@@ -105,6 +105,7 @@ Bogdan Opanchuk
 BorisZZZ
 Brad Erickson
 Bradley Ayers
+Branch Vincent
 Brandon L. Reiss
 Brandt Bucher
 Brannon Dorsey
@@ -131,11 +132,13 @@ Carol Willing
 Carter Thayer
 Cass
 Chandrasekhar Atina
+Charlie Marsh
 Chih-Hsuan Yen
 Chris Brinker
 Chris Hunt
 Chris Jerdonek
 Chris Kuehl
+Chris Markiewicz
 Chris McDonough
 Chris Pawley
 Chris Pryer
@@ -234,6 +237,7 @@ Dos Moonen
 Douglas Thor
 DrFeathers
 Dustin Ingram
+Dustin Rodrigues
 Dwayne Bailey
 Ed Morley
 Edgar Ramírez
@@ -365,12 +369,14 @@ Jeff Dairiki
 Jeff Widman
 Jelmer Vernooij
 jenix21
+Jeremy Fleischman
 Jeremy Stanley
 Jeremy Zafran
 Jesse Rittner
 Jiashuo Li
 Jim Fisher
 Jim Garrison
+Jinzhe Zeng
 Jiun Bae
 Jivan Amara
 Joe Bylund
@@ -391,6 +397,7 @@ Jorge Niedbalski
 Joseph Bylund
 Joseph Long
 Josh Bronson
+Josh Cannon
 Josh Hansen
 Josh Schneier
 Joshua
@@ -425,6 +432,7 @@ konstin
 kpinc
 Krishna Oza
 Kumar McMillan
+Kuntal Majumder
 Kurt McKee
 Kyle Persohn
 lakshmanaram
@@ -513,6 +521,7 @@ Miro Hrončok
 Monica Baluna
 montefra
 Monty Taylor
+morotti
 mrKazzila
 Muha Ajjan
 Nadav Wexler
@@ -625,6 +634,7 @@ Richard Jones
 Richard Si
 Ricky Ng-Adam
 Rishi
+rmorotti
 RobberPhex
 Robert Collins
 Robert McGibbon
@@ -700,6 +710,7 @@ Stéphane Klein
 Sumana Harihareswara
 Surbhi Sharma
 Sviatoslav Sydorenko
+Sviatoslav Sydorenko (Святослав Сидоренко)
 Swat009
 Sylvain
 Takayuki SHIMIZUKAWA

+ 1 - 1
contrib/python/pip/pip/__init__.py

@@ -1,6 +1,6 @@
 from typing import List, Optional
 
-__version__ = "24.1.2"
+__version__ = "24.2"
 
 
 def main(args: Optional[List[str]] = None) -> int:

+ 3 - 2
contrib/python/pip/pip/_internal/build_env.py

@@ -12,7 +12,6 @@ from types import TracebackType
 from typing import TYPE_CHECKING, Iterable, List, Optional, Set, Tuple, Type, Union
 
 from pip._vendor.certifi import where
-from pip._vendor.packaging.requirements import Requirement
 from pip._vendor.packaging.version import Version
 
 from pip import __file__ as pip_location
@@ -20,6 +19,7 @@ from pip._internal.cli.spinners import open_spinner
 from pip._internal.locations import get_platlib, get_purelib, get_scheme
 from pip._internal.metadata import get_default_environment, get_environment
 from pip._internal.utils.logging import VERBOSE
+from pip._internal.utils.packaging import get_requirement
 from pip._internal.utils.subprocess import call_subprocess
 from pip._internal.utils.temp_dir import TempDirectory, tempdir_kinds
 
@@ -184,7 +184,7 @@ class BuildEnvironment:
                 else get_default_environment()
             )
             for req_str in reqs:
-                req = Requirement(req_str)
+                req = get_requirement(req_str)
                 # We're explicitly evaluating with an empty extra value, since build
                 # environments are not provided any mechanism to select specific extras.
                 if req.marker is not None and not req.marker.evaluate({"extra": ""}):
@@ -241,6 +241,7 @@ class BuildEnvironment:
             "--prefix",
             prefix.path,
             "--no-warn-script-location",
+            "--disable-pip-version-check",
         ]
         if logger.getEffectiveLevel() <= logging.DEBUG:
             args.append("-vv")

+ 61 - 64
contrib/python/pip/pip/_internal/cli/base_command.py

@@ -1,6 +1,5 @@
 """Base Command class, and related routines"""
 
-import functools
 import logging
 import logging.config
 import optparse
@@ -8,8 +7,9 @@ import os
 import sys
 import traceback
 from optparse import Values
-from typing import Any, Callable, List, Optional, Tuple
+from typing import List, Optional, Tuple
 
+from pip._vendor.rich import reconfigure
 from pip._vendor.rich import traceback as rich_traceback
 
 from pip._internal.cli import cmdoptions
@@ -90,6 +90,63 @@ class Command(CommandContextMixIn):
     def run(self, options: Values, args: List[str]) -> int:
         raise NotImplementedError
 
+    def _run_wrapper(self, level_number: int, options: Values, args: List[str]) -> int:
+        def _inner_run() -> int:
+            try:
+                return self.run(options, args)
+            finally:
+                self.handle_pip_version_check(options)
+
+        if options.debug_mode:
+            rich_traceback.install(show_locals=True)
+            return _inner_run()
+
+        try:
+            status = _inner_run()
+            assert isinstance(status, int)
+            return status
+        except DiagnosticPipError as exc:
+            logger.error("%s", exc, extra={"rich": True})
+            logger.debug("Exception information:", exc_info=True)
+
+            return ERROR
+        except PreviousBuildDirError as exc:
+            logger.critical(str(exc))
+            logger.debug("Exception information:", exc_info=True)
+
+            return PREVIOUS_BUILD_DIR_ERROR
+        except (
+            InstallationError,
+            BadCommand,
+            NetworkConnectionError,
+        ) as exc:
+            logger.critical(str(exc))
+            logger.debug("Exception information:", exc_info=True)
+
+            return ERROR
+        except CommandError as exc:
+            logger.critical("%s", exc)
+            logger.debug("Exception information:", exc_info=True)
+
+            return ERROR
+        except BrokenStdoutLoggingError:
+            # Bypass our logger and write any remaining messages to
+            # stderr because stdout no longer works.
+            print("ERROR: Pipe to stdout was broken", file=sys.stderr)
+            if level_number <= logging.DEBUG:
+                traceback.print_exc(file=sys.stderr)
+
+            return ERROR
+        except KeyboardInterrupt:
+            logger.critical("Operation cancelled by user")
+            logger.debug("Exception information:", exc_info=True)
+
+            return ERROR
+        except BaseException:
+            logger.critical("Exception:", exc_info=True)
+
+            return UNKNOWN_ERROR
+
     def parse_args(self, args: List[str]) -> Tuple[Values, List[str]]:
         # factored out for testability
         return self.parser.parse_args(args)
@@ -115,6 +172,7 @@ class Command(CommandContextMixIn):
         # Set verbosity so that it can be used elsewhere.
         self.verbosity = options.verbose - options.quiet
 
+        reconfigure(no_color=options.no_color)
         level_number = setup_logging(
             verbosity=self.verbosity,
             no_color=options.no_color,
@@ -170,65 +228,4 @@ class Command(CommandContextMixIn):
                 )
                 options.cache_dir = None
 
-        def intercepts_unhandled_exc(
-            run_func: Callable[..., int]
-        ) -> Callable[..., int]:
-            @functools.wraps(run_func)
-            def exc_logging_wrapper(*args: Any) -> int:
-                try:
-                    status = run_func(*args)
-                    assert isinstance(status, int)
-                    return status
-                except DiagnosticPipError as exc:
-                    logger.error("%s", exc, extra={"rich": True})
-                    logger.debug("Exception information:", exc_info=True)
-
-                    return ERROR
-                except PreviousBuildDirError as exc:
-                    logger.critical(str(exc))
-                    logger.debug("Exception information:", exc_info=True)
-
-                    return PREVIOUS_BUILD_DIR_ERROR
-                except (
-                    InstallationError,
-                    BadCommand,
-                    NetworkConnectionError,
-                ) as exc:
-                    logger.critical(str(exc))
-                    logger.debug("Exception information:", exc_info=True)
-
-                    return ERROR
-                except CommandError as exc:
-                    logger.critical("%s", exc)
-                    logger.debug("Exception information:", exc_info=True)
-
-                    return ERROR
-                except BrokenStdoutLoggingError:
-                    # Bypass our logger and write any remaining messages to
-                    # stderr because stdout no longer works.
-                    print("ERROR: Pipe to stdout was broken", file=sys.stderr)
-                    if level_number <= logging.DEBUG:
-                        traceback.print_exc(file=sys.stderr)
-
-                    return ERROR
-                except KeyboardInterrupt:
-                    logger.critical("Operation cancelled by user")
-                    logger.debug("Exception information:", exc_info=True)
-
-                    return ERROR
-                except BaseException:
-                    logger.critical("Exception:", exc_info=True)
-
-                    return UNKNOWN_ERROR
-
-            return exc_logging_wrapper
-
-        try:
-            if not options.debug_mode:
-                run = intercepts_unhandled_exc(self.run)
-            else:
-                run = self.run
-                rich_traceback.install(show_locals=True)
-            return run(options, args)
-        finally:
-            self.handle_pip_version_check(options)
+        return self._run_wrapper(level_number, options, args)

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