betodealmeida / shillelagh

Making it easy to query APIs via SQL

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

importlib_metadata is not correctly imported

Mulugruntz opened this issue · comments

Describe the bug
This is a bug introduced in #371.

To Reproduce

  1. Use python 3.11, install shillelagh==1.2.7
  2. In an interpreter, run:
from shillelagh.functions import sleep
Traceback (most recent call last):
  File "/home/sgiffard/.local/share/JetBrains/Toolbox/apps/pycharm-professional/plugins/python/helpers/pydev/pydevconsole.py", line 364, in runcode
    coro = func()
           ^^^^^^
  File "<input>", line 1, in <module>
  File "/home/sgiffard/.local/share/JetBrains/Toolbox/apps/pycharm-professional/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/sgiffard/.cache/pypoetry/virtualenvs/gh-automation-base-NsJ1kP3S-py3.11/lib/python3.11/site-packages/shillelagh/functions.py", line 8, in <module>
    from importlib_metadata import distribution
  File "/home/sgiffard/.local/share/JetBrains/Toolbox/apps/pycharm-professional/plugins/python/helpers/pydev/_pydev_bundle/pydev_import_hook.py", line 21, in do_import
    module = self._system_import(name, *args, **kwargs)
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ModuleNotFoundError: No module named 'importlib_metadata'

Expected behavior
It does not crash.

Desktop (please complete the following information):

  • OS: Fedora 38

Additional context
Add any other context about the problem here.