Open voice-of-texnoforge opened 3 years ago
Yes, good idea. Can’t see any reason not to do this.
This would also avoid the warning that I get with python 3.12:
.../lib/python3.12/site-packages/jsonrpcserver/__init__.py:19: in <module>
from .async_main import (
.../lib/python3.12/site-packages/jsonrpcserver/async_main.py:7: in <module>
from .main import default_validator, default_deserializer
.../lib/python3.12/site-packages/jsonrpcserver/main.py:29: in <module>
schema = json.loads(importlib.resources.read_text(__package__, "request-schema.json"))
/usr/lib/python3.12/importlib/resources/_legacy.py:25: in wrapper
return func(*args, **kwargs)
/usr/lib/python3.12/importlib/resources/_legacy.py:79: in read_text
with open_text(package, resource, encoding, errors) as fp:
/usr/lib/python3.12/importlib/resources/_legacy.py:18: in wrapper
warnings.warn(
E DeprecationWarning: open_text is deprecated. Use files() instead. Refer to https://importlib-resources.readthedocs.io/en/latest/using.html#migrating-from-legacy for migration advice.
Fixed in the version 6
Hello,
I've hit a little issue when using
jsonrpcserver
with PyInstaller:I've submitted a simple hook for PyInstaller which fixes this but I've hit similar issues with python packaging and non-py files many times in the past and I suggest you consider moving the
.json
data into a.py
file unless there's a good reason not to - it can be a newrequest_schema.py
or any of existing files.This would prevent similar problems with python packaging in various tools without requiring additional effort.
Either way, thanks for the nice library ♥