I want to pack a sanic project into .whl or .zip file. File structure:
-- my_project
L app.py
L static
L __init__.py
L index.html
L abc.js
L abc.css
to access static file resources, I changed the following line
app.static('/', './static/index.html', content_type="text/html; charset=utf-8")
to:
import importlib.resources
app.static('/', importlib.resources.path('my_project.static', 'index.html'), content_type="text/html; charset=utf-8")
Question: how do I change the following line to access folders?
app.static('/static', './static/')
folders seems to be recognized by importlib.resources as NOT resources
importlib.resources.is_resource('my_project.static', 'index.html') # True
importlib.resources.is_resource('my_project.static', '') # False
importlib.resources.is_resource('my_project', 'static') # False