Skip to content

Commit

Permalink
final tweaks for now
Browse files Browse the repository at this point in the history
  • Loading branch information
Zac-HD committed Oct 9, 2024
1 parent 14e5077 commit 8b94a84
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 14 deletions.
4 changes: 4 additions & 0 deletions hypothesis-python/RELEASE.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
RELEASE_TYPE: minor

This release drops support for Python 3.8, `which reached end of life on
2024-10-07 <https://devguide.python.org/versions/>`__.
2 changes: 0 additions & 2 deletions hypothesis-python/src/hypothesis/extra/ghostwriter.py
Original file line number Diff line number Diff line change
Expand Up @@ -629,8 +629,6 @@ def _imports_for_strategy(strategy):
for imp in _imports_for_object(_strip_typevars(arg))
}
if re.match(r"from_(type|regex)\(", repr(strategy)):
if repr(strategy).startswith("from_type("):
return {module for module, _ in imports}
return imports
elif _get_module(strategy.function).startswith("hypothesis.extra."):
module = _get_module(strategy.function).replace("._array_helpers", ".numpy")
Expand Down
14 changes: 2 additions & 12 deletions hypothesis-python/src/hypothesis/strategies/_internal/types.py
Original file line number Diff line number Diff line change
Expand Up @@ -484,13 +484,7 @@ def from_typing_type(thing):
literals.append(arg)
return st.sampled_from(literals)
if is_annotated_type(thing):
annotated_strategy = find_annotated_strategy(thing)
if annotated_strategy is not None:
return annotated_strategy
args = thing.__args__
assert args, "it's impossible to make an annotated type with no args"
annotated_type = args[0]
return st.from_type(annotated_type)
return find_annotated_strategy(thing)

# Some "generic" classes are not generic *in* anything - for example both
# Hashable and Sized have `__args__ == ()`
Expand Down Expand Up @@ -845,11 +839,7 @@ def really_inner(thing):
return fallback
return func(thing)

try:
type_ = get_origin(type_)
except Exception:
pass
_global_type_lookup[type_] = really_inner
_global_type_lookup[get_origin(type_) or type_] = really_inner
return really_inner

return inner
Expand Down

0 comments on commit 8b94a84

Please sign in to comment.