It seems that non-python resources are included in python distribution packages one of 4 ways:
- Manifest.in file (I'm not sure when this is preferred over package_data or data_files)
- package_data in
setup.py(for including resources within python import packages) - data_files in
setup.py(for including resources outside python import packages) - something called
setuptools-scm(which I believe uses your version control system to find resources instead of manifest.in or something)
Which of these are accessible from
importlib.resources?
(It is my understanding thatimportlib.resourcesis the preferred way to access such resources.) If any of these are not accessible viaimportlib.resources, then how could/should one access such resources?Other people online have been scolded for the suggestion of using
__file__to find the path to a resource because installed wheel distributions may be stored as zip files and therefore there won't even be a proper path to your resources. When are wheels extracted into site-packages and when do they remain zipped?