aboutsummaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authorrobot-piglet <robot-piglet@yandex-team.com>2024-03-15 09:58:31 +0300
committerrobot-piglet <robot-piglet@yandex-team.com>2024-03-15 10:06:24 +0300
commit972deb0a3ffc507a9ff49edafa83fde2ab49df83 (patch)
treeaee7455688f67380ef94e068824198308bd9bcdd /contrib
parent9393620eda812520fa0b7031618193a463a0556b (diff)
downloadydb-972deb0a3ffc507a9ff49edafa83fde2ab49df83.tar.gz
Intermediate changes
Diffstat (limited to 'contrib')
-rw-r--r--contrib/python/hypothesis/py3/.dist-info/METADATA2
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/extra/array_api.py4
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/stateful.py33
-rw-r--r--contrib/python/hypothesis/py3/hypothesis/version.py2
-rw-r--r--contrib/python/hypothesis/py3/ya.make2
5 files changed, 24 insertions, 19 deletions
diff --git a/contrib/python/hypothesis/py3/.dist-info/METADATA b/contrib/python/hypothesis/py3/.dist-info/METADATA
index fa11a20888..6b4024e132 100644
--- a/contrib/python/hypothesis/py3/.dist-info/METADATA
+++ b/contrib/python/hypothesis/py3/.dist-info/METADATA
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: hypothesis
-Version: 6.98.13
+Version: 6.98.15
Summary: A library for property-based testing
Home-page: https://hypothesis.works
Author: David R. MacIver and Zac Hatfield-Dodds
diff --git a/contrib/python/hypothesis/py3/hypothesis/extra/array_api.py b/contrib/python/hypothesis/py3/hypothesis/extra/array_api.py
index d62418f317..e9ff8b3c9e 100644
--- a/contrib/python/hypothesis/py3/hypothesis/extra/array_api.py
+++ b/contrib/python/hypothesis/py3/hypothesis/extra/array_api.py
@@ -69,10 +69,10 @@ __all__ = [
]
-RELEASED_VERSIONS = ("2021.12", "2022.12")
+RELEASED_VERSIONS = ("2021.12", "2022.12", "2023.12")
NOMINAL_VERSIONS = (*RELEASED_VERSIONS, "draft")
assert sorted(NOMINAL_VERSIONS) == list(NOMINAL_VERSIONS) # sanity check
-NominalVersion = Literal["2021.12", "2022.12", "draft"]
+NominalVersion = Literal["2021.12", "2022.12", "2023.12", "draft"]
assert get_args(NominalVersion) == NOMINAL_VERSIONS # sanity check
diff --git a/contrib/python/hypothesis/py3/hypothesis/stateful.py b/contrib/python/hypothesis/py3/hypothesis/stateful.py
index 60cd92721c..58a2277161 100644
--- a/contrib/python/hypothesis/py3/hypothesis/stateful.py
+++ b/contrib/python/hypothesis/py3/hypothesis/stateful.py
@@ -15,7 +15,7 @@ a single value.
Notably, the set of steps available at any point may depend on the
execution to date.
"""
-
+import collections
import inspect
from copy import copy
from functools import lru_cache
@@ -268,7 +268,8 @@ class RuleBasedStateMachine(metaclass=StateMachineMeta):
if not self.rules():
raise InvalidDefinition(f"Type {type(self).__name__} defines no rules")
self.bundles: Dict[str, list] = {}
- self.name_counter = 1
+ self.names_counters: collections.Counter = collections.Counter()
+ self.names_list: list[str] = []
self.names_to_values: Dict[str, Any] = {}
self.__stream = StringIO()
self.__printer = RepresentationPrinter(
@@ -301,15 +302,16 @@ class RuleBasedStateMachine(metaclass=StateMachineMeta):
def __repr__(self):
return f"{type(self).__name__}({nicerepr(self.bundles)})"
- def _new_name(self):
- result = f"v{self.name_counter}"
- self.name_counter += 1
+ def _new_name(self, target):
+ result = f"{target}_{self.names_counters[target]}"
+ self.names_counters[target] += 1
+ self.names_list.append(result)
return result
def _last_names(self, n):
- assert self.name_counter > n
- count = self.name_counter
- return [f"v{i}" for i in range(count - n, count)]
+ len_ = len(self.names_list)
+ assert len_ >= n
+ return self.names_list[len_ - n :]
def bundle(self, name):
return self.bundles.setdefault(name, [])
@@ -364,7 +366,8 @@ class RuleBasedStateMachine(metaclass=StateMachineMeta):
if len(result.values) == 1:
output_assignment = f"({self._last_names(1)[0]},) = "
elif result.values:
- output_names = self._last_names(len(result.values))
+ number_of_last_names = len(rule.targets) * len(result.values)
+ output_names = self._last_names(number_of_last_names)
output_assignment = ", ".join(output_names) + " = "
else:
output_assignment = self._last_names(1)[0] + " = "
@@ -372,12 +375,14 @@ class RuleBasedStateMachine(metaclass=StateMachineMeta):
return f"{output_assignment}state.{rule.function.__name__}({args})"
def _add_result_to_targets(self, targets, result):
- name = self._new_name()
- self.__printer.singleton_pprinters.setdefault(
- id(result), lambda obj, p, cycle: p.text(name)
- )
- self.names_to_values[name] = result
for target in targets:
+ name = self._new_name(target)
+
+ def printer(obj, p, cycle, name=name):
+ return p.text(name)
+
+ self.__printer.singleton_pprinters.setdefault(id(result), printer)
+ self.names_to_values[name] = result
self.bundles.setdefault(target, []).append(VarReference(name))
def check_invariants(self, settings, output, runtimes):
diff --git a/contrib/python/hypothesis/py3/hypothesis/version.py b/contrib/python/hypothesis/py3/hypothesis/version.py
index 187c174def..f7e0632c1c 100644
--- a/contrib/python/hypothesis/py3/hypothesis/version.py
+++ b/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, 98, 13)
+__version_info__ = (6, 98, 15)
__version__ = ".".join(map(str, __version_info__))
diff --git a/contrib/python/hypothesis/py3/ya.make b/contrib/python/hypothesis/py3/ya.make
index 1c48b292f9..9f6cd41682 100644
--- a/contrib/python/hypothesis/py3/ya.make
+++ b/contrib/python/hypothesis/py3/ya.make
@@ -2,7 +2,7 @@
PY3_LIBRARY()
-VERSION(6.98.13)
+VERSION(6.98.15)
LICENSE(MPL-2.0)