You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the code below is straight out of the README. i think you just need to add from importlib import util to api.py
Python 3.11.4 | packaged by conda-forge | (main, Jun 10 2023, 18:08:17) [GCC 12.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import portion
>>> class IntInterval(portion.AbstractDiscreteInterval):
... _step = 1
...
>>> D = portion.create_api(IntInterval)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/arthurb@hhmi.org/bin/mambaforge/envs/pyinterval/lib/python3.11/site-packages/portion/api.py", line 64, in create_api
module = importlib.util.module_from_spec(
^^^^^^^^^^^^^^
AttributeError: module 'importlib' has no attribute 'util'
i would tell you what version of portion i'm using, but __version__ is not defined:
>>> portion.__version__
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
AttributeError: module 'portion' has no attribute '__version__'
The text was updated successfully, but these errors were encountered:
I'll try to release a fix ASAP, you're right, import importlib.util should do the trick. I don't know why this bug hasn't been catched by the tests....
Ok, I got why the bug wasn't catched by our test: importlib.util was imported by another module (likely pytest or a dependency) making util available in importlib without an explicit import on our side.
the code below is straight out of the README. i think you just need to add
from importlib import util
to api.pyi would tell you what version of portion i'm using, but
__version__
is not defined:The text was updated successfully, but these errors were encountered: