Cannot import on 3.13, importlib.resources.read_text is removed

#36 · closed · 1 comments

View on GitHub ↗

jakkdl

``` tests/test_flake8_trio.py:24: in <module> from hypothesmith import from_grammar, from_node .tox/py313/lib/python3.13/site-packages/hypothesmith/__init__.py:3: in <module> from hypothesmith.cst import from_node .tox/py313/lib/python3.13/site-packages/hypothesmith/cst.py:24: in <module> from .syntactic import ALLOWED_CHARS .tox/py313/lib/python3.13/site-packages/hypothesmith/syntactic.py:7: in <module> from importlib.resources import read_text E ImportError: cannot import name 'read_text' from 'importlib.resources' (/usr/lib/python3.13/importlib/resources/__init__.py) ``` https://docs.python.org/3/library/importlib.resources.html#importlib.resources.read_text says calls to the method can be replaced by ```python files(package).joinpath(resource).read_text(encoding=encoding) ``` This is the only blocker (I think) from testing flake8-trio with 3.13

Comments

jakkdl

Ah, there's an explicit comment in `src/hypothesmith/syntactic.py` about it: https://github.com/Zac-HD/hypothesmith/blob/33d6cacffb90d5b3871f2559fb23b5914e8158a1/src/hypothesmith/syntactic.py#L14-L19 3.8 is end-of-life, so presumably fine to drop it now.