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

Pyoxidizer doesn't work for jsonschema_specifications #749

Open
fabioz opened this issue Jun 10, 2024 · 1 comment
Open

Pyoxidizer doesn't work for jsonschema_specifications #749

fabioz opened this issue Jun 10, 2024 · 1 comment

Comments

@fabioz
Copy link

fabioz commented Jun 10, 2024

The issue here is that the jsonschema_specifications._core._schemas() function does:

from importlib.resources import files

for version in files(__package__).joinpath("schemas").iterdir():

and then it will not really find anything to register.

Printing the return of the files(...) it gives:

<importlib._adapters.DegenerateFiles.Path object at 0x0000015E5D83A9B0>

I added

if "jsonschema_specifications" in resource.name:
    resource.add_location = "filesystem-relative:lib"
    resource.add_source = True

So, those resources even have a __file__, but still, importlib.resources.files(...) doesn't work as intended.

This was also reported at: python-jsonschema/jsonschema-specifications#61, but unfortunately the library can't be changed to accommodate a different API.

@fabioz
Copy link
Author

fabioz commented Jun 10, 2024

Note: this is on Python 3.10.9

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

No branches or pull requests

1 participant