Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

jsonschema hook is broken for jsonschema >= 4.18 #613

Closed
yabirgb opened this issue Jul 7, 2023 · 0 comments · Fixed by #614
Closed

jsonschema hook is broken for jsonschema >= 4.18 #613

yabirgb opened this issue Jul 7, 2023 · 0 comments · Fixed by #614
Labels

Comments

@yabirgb
Copy link

yabirgb commented Jul 7, 2023

Which library is the hook for?

jsonschema

Additional context

In https://github.com/python-jsonschema/jsonschema/releases/tag/v4.18.0 jsonschema moved the schema files to https://github.com/python-jsonschema/jsonschema-specifications/tree/v2023.06.1/jsonschema_specifications/schemas in the commit python-jsonschema/jsonschema@bf94d57

this made the packaging fail as can be seen in this trace

    File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
    File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
    File "rotkehlchen/accounting/types.py", line 4, in <module>
      import jsonschema
    File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
    File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
    File "jsonschema/__init__.py", line 17, in <module>
    File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
    File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
    File "jsonschema/validators.py", line 19, in <module>
    File "<frozen importlib._bootstrap>", line 1027, in _find_and_load
    File "<frozen importlib._bootstrap>", line 1006, in _find_and_load_unlocked
    File "<frozen importlib._bootstrap>", line 688, in _load_unlocked
    File "PyInstaller/loader/pyimod02_importers.py", line 499, in exec_module
    File "jsonschema_specifications/__init__.py", line 11, in <module>
    File "referencing/_core.py", line 297, in __rmatmul__
    File "jsonschema_specifications/_core.py", line 27, in _schemas
    File "pathlib.py", line 1017, in iterdir
  FileNotFoundError: [Errno 2] No such file or directory: '/tmp/_MEIDT4mfu/jsonschema_specifications/schemas'
  [3893] Failed to execute script 'rotkehlchen-script' due to unhandled exception!
  2023-07-07 00:59:29,845 - package - ERROR: backend binary check failed

to fix it I added a custom hook rotki/rotki#6385

from PyInstaller.utils.hooks import collect_data_files, copy_metadata

datas = copy_metadata('jsonschema_specifications')
datas = collect_data_files('jsonschema_specifications')

but probably jsonschema will be broken for other users that don't have the jsonschema version pinned.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant