I'm building my first python package (which I then install with pip) and I need to use some non-python files. In these answers, it is explained that I should use the pkg_resources
function. But I can't figure out a working example. Let say I have this project structure:
package_name/
----data/
--------image.png
----package_name/
--------__init__.py
--------file.py
----setup.py
----MANIFEST.in
----conf.yml
Now I want to access conf.yml
and image.png
from file.py
. How should I proceed in:
- file.py ?
- setup.py ?
- MANIFEST.in ?