Open fabioz opened 5 months ago
The issue here is that the jsonschema_specifications._core._schemas() function does:
jsonschema_specifications._core._schemas()
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:
files(...)
<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.
__file__
importlib.resources.files(...)
This was also reported at: https://github.com/python-jsonschema/jsonschema-specifications/issues/61, but unfortunately the library can't be changed to accommodate a different API.
Note: this is on Python 3.10.9
The issue here is that the
jsonschema_specifications._core._schemas()
function does: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
So, those resources even have a
__file__
, but still,importlib.resources.files(...)
doesn't work as intended.This was also reported at: https://github.com/python-jsonschema/jsonschema-specifications/issues/61, but unfortunately the library can't be changed to accommodate a different API.