diff options
| author | robot-piglet <[email protected]> | 2026-04-28 17:28:48 +0300 |
|---|---|---|
| committer | robot-piglet <[email protected]> | 2026-04-28 18:14:59 +0300 |
| commit | 51404a75f24886d2013948eec0a3a45e5428358a (patch) | |
| tree | 6928d3044f936c70fd2f9038189a275ba551879a /contrib/python/hypothesis | |
| parent | 2353cef3307172edb200a4d35dfc3ac78d560673 (diff) | |
Intermediate changes
commit_hash:fa377c0cf2cb41fd405ffb0c9d5bbe4fd73ea389
Diffstat (limited to 'contrib/python/hypothesis')
9 files changed, 51 insertions, 14 deletions
diff --git a/contrib/python/hypothesis/py3/.dist-info/METADATA b/contrib/python/hypothesis/py3/.dist-info/METADATA index df45d5b4e23..03e92bb0a5b 100644 --- a/contrib/python/hypothesis/py3/.dist-info/METADATA +++ b/contrib/python/hypothesis/py3/.dist-info/METADATA @@ -1,6 +1,6 @@ Metadata-Version: 2.4 Name: hypothesis -Version: 6.151.12 +Version: 6.151.14 Summary: The property-based testing library for Python Author-email: "David R. MacIver and Zac Hatfield-Dodds" <[email protected]> License-Expression: MPL-2.0 @@ -63,7 +63,7 @@ Provides-Extra: crosshair Requires-Dist: hypothesis-crosshair>=0.0.27; extra == "crosshair" Requires-Dist: crosshair-tool>=0.0.102; extra == "crosshair" Provides-Extra: zoneinfo -Requires-Dist: tzdata>=2025.3; (sys_platform == "win32" or sys_platform == "emscripten") and extra == "zoneinfo" +Requires-Dist: tzdata>=2026.1; (sys_platform == "win32" or sys_platform == "emscripten") and extra == "zoneinfo" Provides-Extra: django Requires-Dist: django>=4.2; extra == "django" Provides-Extra: watchdog @@ -84,7 +84,7 @@ Requires-Dist: python-dateutil>=1.4; extra == "all" Requires-Dist: pytz>=2014.1; extra == "all" Requires-Dist: redis>=3.0.0; extra == "all" Requires-Dist: rich>=9.0.0; extra == "all" -Requires-Dist: tzdata>=2025.3; (sys_platform == "win32" or sys_platform == "emscripten") and extra == "all" +Requires-Dist: tzdata>=2026.1; (sys_platform == "win32" or sys_platform == "emscripten") and extra == "all" Requires-Dist: watchdog>=4.0.0; extra == "all" Dynamic: license-file diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/charmap.py b/contrib/python/hypothesis/py3/hypothesis/internal/charmap.py index 6b17f4043e3..b9343b59720 100644 --- a/contrib/python/hypothesis/py3/hypothesis/internal/charmap.py +++ b/contrib/python/hypothesis/py3/hypothesis/internal/charmap.py @@ -310,6 +310,12 @@ def query( min_codepoint = 0 if max_codepoint is None: max_codepoint = sys.maxunicode + + if min_codepoint > max_codepoint: + raise InvalidArgument( + f"min_codepoint={min_codepoint} is greater than max_codepoint={max_codepoint}" + ) + catkey = _category_key(categories) character_intervals = IntervalSet.from_string("".join(include_characters)) exclude_intervals = IntervalSet.from_string("".join(exclude_characters)) @@ -326,12 +332,14 @@ def query( return limited_category_index_cache[qkey] except KeyError: pass - base = _query_for_key(catkey) + result = [] - for u, v in base: + for u, v in _query_for_key(catkey): if v >= min_codepoint and u <= max_codepoint: result.append((max(u, min_codepoint), min(v, max_codepoint))) + result = (IntervalSet(result) | character_intervals) - exclude_intervals if context is None or not context.data.provider.avoid_realization: limited_category_index_cache[qkey] = result + return result diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/provider_conformance.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/provider_conformance.py index 55ced851b5c..558bb686425 100644 --- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/provider_conformance.py +++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/provider_conformance.py @@ -44,8 +44,7 @@ def build_intervals(intervals: list[int]) -> list[tuple[int, int]]: if len(intervals) % 2: intervals = intervals[:-1] intervals.sort() - # help mypy infer tuple[int, ...] -> tuple[int, int] - return list(batched(intervals, 2, strict=True)) # type: ignore + return list(batched(intervals, 2, strict=True)) def interval_lists( diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/providers.py b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/providers.py index f2083381f0c..f3b3daef036 100644 --- a/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/providers.py +++ b/contrib/python/hypothesis/py3/hypothesis/internal/conjecture/providers.py @@ -230,6 +230,9 @@ _constant_strings = { # Ogham text, which contains the only character in the Space Separators # unicode category (Zs) that isn't visually blank: . # noqa: RUF003 "᚛ᚄᚓᚐᚋᚒᚄ ᚑᚄᚂᚑᚏᚅ᚜", + # thai consonant + spacing vowel combinations, which have unusual visual combining behavior + "กา", + "ก ำกำ", # readable variations on text (bolt/italic/script) "𝐓𝐡𝐞 𝐪𝐮𝐢𝐜𝐤 𝐛𝐫𝐨𝐰𝐧 𝐟𝐨𝐱 𝐣𝐮𝐦𝐩𝐬 𝐨𝐯𝐞𝐫 𝐭𝐡𝐞 𝐥𝐚𝐳𝐲 𝐝𝐨𝐠", "𝕿𝖍𝖊 𝖖𝖚𝖎𝖈𝖐 𝖇𝖗𝖔𝖜𝖓 𝖋𝖔𝖝 𝖏𝖚𝖒𝖕𝖘 𝖔𝖛𝖊𝖗 𝖙𝖍𝖊 𝖑𝖆𝖟𝖞 𝖉𝖔𝖌", @@ -251,6 +254,33 @@ _constant_strings = { "मनीष منش", "पन्ह पन्ह त्र र्च कृकृ ड्ड न्हृे إلا بسم الله", "lorem لا بسم الله ipsum 你好1234你好", + # unicode charaacters causing unconditional line breaks, as defined by UAX #14: + # https://www.unicode.org/reports/tr14/. + # + # We've seen multiple bugs caused by assuming `str.splitlines` is equivalent to + # splitting over "\n", while it actually splits over all line breaks! + # + # We intersperse the line breaks with normal characters to increase the likelihood + # of triggering such a bug. + ( + "a" + "\u000a" # line feed (class: LF) + "b" + "\u000d" # carriage return (class: CR) + "c" + "\u0085" # next line (class: NL) + "d" + "\u000b" # line tabulation (class: BK) + "e" + "\u000c" # form feed (class: BK) + "f" + "\u2028" # line separator (class: BK) + "g" + "\u2029" # paragraph separator (class: BK) + "h" + "\u000d\u000a" # CR+LF + "i" + ), } diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/observability.py b/contrib/python/hypothesis/py3/hypothesis/internal/observability.py index ad674f22651..121a0f39900 100644 --- a/contrib/python/hypothesis/py3/hypothesis/internal/observability.py +++ b/contrib/python/hypothesis/py3/hypothesis/internal/observability.py @@ -298,7 +298,7 @@ def remove_observability_callback(f: CallbackT, /) -> None: callbacks for this thread. """ if f in _callbacks_all_threads: - _callbacks_all_threads.remove(cast(CallbackAllThreadsT, f)) + _callbacks_all_threads.remove(f) thread_id = threading.get_ident() if thread_id not in _callbacks: @@ -306,7 +306,7 @@ def remove_observability_callback(f: CallbackT, /) -> None: callbacks = _callbacks[thread_id] if f in callbacks: - callbacks.remove(cast(CallbackThreadT, f)) + callbacks.remove(f) if not callbacks: del _callbacks[thread_id] diff --git a/contrib/python/hypothesis/py3/hypothesis/internal/reflection.py b/contrib/python/hypothesis/py3/hypothesis/internal/reflection.py index f462b10fcf1..8e36cdfd257 100644 --- a/contrib/python/hypothesis/py3/hypothesis/internal/reflection.py +++ b/contrib/python/hypothesis/py3/hypothesis/internal/reflection.py @@ -272,7 +272,7 @@ def get_pretty_function_description(f: object) -> str: return pretty(f) if not hasattr(f, "__name__"): return repr(f) - name = f.__name__ # type: ignore + name = f.__name__ if name == "<lambda>": return lambda_sources.lambda_description(f) elif isinstance(f, (types.MethodType, types.BuiltinMethodType)): @@ -518,7 +518,7 @@ def is_identity_function(f: Callable) -> bool: # We know that f accepts a single positional argument, now check that its # code object is simply "return first unbound argument". - template = (lambda self, x: x) if bound_args else (lambda x: x) # type: ignore + template = (lambda self, x: x) if bound_args else (lambda x: x) try: return code.co_code == template.__code__.co_code except AttributeError: # pragma: no cover # pypy only diff --git a/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/core.py b/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/core.py index c6e5cf97000..48c57d2aa3f 100644 --- a/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/core.py +++ b/contrib/python/hypothesis/py3/hypothesis/strategies/_internal/core.py @@ -877,7 +877,7 @@ def from_regex( regex: str | Pattern[str], *, fullmatch: bool = False, - alphabet: str | SearchStrategy[str] = characters(codec="utf-8"), + alphabet: str | SearchStrategy[str] | None = characters(codec="utf-8"), ) -> SearchStrategy[str]: # pragma: no cover ... diff --git a/contrib/python/hypothesis/py3/hypothesis/version.py b/contrib/python/hypothesis/py3/hypothesis/version.py index 62a2d41b137..418eb67555c 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, 151, 12) +__version_info__ = (6, 151, 14) __version__ = ".".join(map(str, __version_info__)) diff --git a/contrib/python/hypothesis/py3/ya.make b/contrib/python/hypothesis/py3/ya.make index 84f4b92d757..05d2a6f8eac 100644 --- a/contrib/python/hypothesis/py3/ya.make +++ b/contrib/python/hypothesis/py3/ya.make @@ -2,7 +2,7 @@ PY3_LIBRARY() -VERSION(6.151.12) +VERSION(6.151.14) LICENSE(MPL-2.0) |
