Skip to content

Commit 107e404

Browse files
committed
[GR-65570] add hypothesis patch
1 parent 500d26d commit 107e404

File tree

2 files changed

+78
-1
lines changed

2 files changed

+78
-1
lines changed
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
diff --git a/hypothesis/core.py b/hypothesis/core.py
2+
index 98305ce..82fec12 100644
3+
--- a/hypothesis/core.py
4+
+++ b/hypothesis/core.py
5+
@@ -72,6 +72,7 @@ from hypothesis.errors import (
6+
from hypothesis.internal import observability
7+
from hypothesis.internal.compat import (
8+
PYPY,
9+
+ GRAALPY,
10+
BaseExceptionGroup,
11+
EllipsisType,
12+
add_note,
13+
@@ -1411,7 +1412,7 @@ class StateForActualGivenExecution:
14+
# we'd expect to do so reliably, i.e. on CPython>=3.12)
15+
if (
16+
sys.version_info[:2] >= (3, 12)
17+
- and not PYPY
18+
+ and not PYPY and not GRAALPY
19+
and self._should_trace()
20+
and not Tracer.can_trace()
21+
): # pragma: no cover
22+
diff --git a/hypothesis/internal/scrutineer.py b/hypothesis/internal/scrutineer.py
23+
index 65612e8..2b91963 100644
24+
--- a/hypothesis/internal/scrutineer.py
25+
+++ b/hypothesis/internal/scrutineer.py
26+
@@ -24,7 +24,7 @@ from pathlib import Path
27+
from typing import TYPE_CHECKING, Optional
28+
29+
from hypothesis._settings import Phase, Verbosity
30+
-from hypothesis.internal.compat import PYPY
31+
+from hypothesis.internal.compat import PYPY, GRAALPY
32+
from hypothesis.internal.escalation import is_hypothesis_file
33+
34+
if TYPE_CHECKING:
35+
@@ -47,7 +47,7 @@ def should_trace_file(fname: str) -> bool:
36+
# tool_id = 1 is designated for coverage, but we intentionally choose a
37+
# non-reserved tool id so we can co-exist with coverage tools.
38+
MONITORING_TOOL_ID = 3
39+
-if sys.version_info[:2] >= (3, 12):
40+
+if sys.version_info[:2] >= (3, 12) and not GRAALPY:
41+
MONITORING_EVENTS = {sys.monitoring.events.LINE: "trace_line"}
42+
43+
44+
@@ -66,7 +66,7 @@ class Tracer:
45+
return (
46+
(sys.version_info[:2] < (3, 12) and sys.gettrace() is None)
47+
or (
48+
- sys.version_info[:2] >= (3, 12)
49+
+ sys.version_info[:2] >= (3, 12) and not GRAALPY
50+
and sys.monitoring.get_tool(MONITORING_TOOL_ID) is None
51+
)
52+
) and not PYPY
53+
@@ -99,7 +99,7 @@ class Tracer:
54+
if not self._should_trace:
55+
return self
56+
57+
- if sys.version_info[:2] < (3, 12):
58+
+ if sys.version_info[:2] < (3, 12) or GRAALPY:
59+
sys.settrace(self.trace)
60+
return self
61+
62+
@@ -115,7 +115,7 @@ class Tracer:
63+
if not self._should_trace:
64+
return
65+
66+
- if sys.version_info[:2] < (3, 12):
67+
+ if sys.version_info[:2] < (3, 12) or GRAALPY:
68+
sys.settrace(None)
69+
return
70+

graalpython/lib-graalpython/patches/metadata.toml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -176,7 +176,14 @@ license = 'BSD-3-Clause'
176176

177177
[[hypothesis.rules]]
178178
install-priority = 1
179-
version = '>= 6.69.0'
179+
# can be removed once [GR-65570] is done
180+
patch = 'hypothesis-6.135.0.patch'
181+
version = '>= 6.120.0'
182+
license = 'MPL-2.0'
183+
184+
[[hypothesis.rules]]
185+
install-priority = 0
186+
version = '>= 6.69.0, < 6.120.0'
180187

181188
[[hypothesis.rules]]
182189
install-priority = 0

0 commit comments

Comments
 (0)