web: Use importlib to load static web ressources
mhthies opened this issue · comments
Goal is, to make SHC "zip_safe", i.e. make it executable directly from an unextracted wheel-package. This requires to load ressource files in a way that transparently extracts them from from the package if required, e.g. importlib.ressources
.
For reference, see
- https://setuptools.pypa.io/en/latest/userguide/miscellaneous.html#setting-the-zip-safe-flag
- https://setuptools.pypa.io/en/latest/userguide/datafiles.html#accessing-data-files-at-runtime
However, I'm not sure if this is possible with our current approach of serving our static web ressources from a single static directory (see shc/web/interface.py:112).