You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
I want to install a data file which is in my repository root when installing my package. I don't want to install it in a specific directory. It's a list of contributors which is loaded by an about dialog. So this file is not a package data file.
The file is installed in $prefix/share/myproject. The actual path is irrelevant for me.
The documentation tells me:
The data files can also be accessed using the ResourceManager API,
by specifying a Requirement instead of a package name
from pkg_resources import Requirement, resource_filename
filename = resource_filename(Requirement.parse("myproject"),"share/myproject/CONTRIBUTORS.txt")
This returns a path relative to the site-packages directory. When installed in developer mode with pip install --user -e . this is relative to the src directory (from the find_packages call?). Both paths are not pointing to the correct file as they should if the documentation is correct.
If the data_file option is a supported feature then either the documentation is wrong or the ResourceManager is using the wrong path. If this is not supported any more then it needs to be removed from the documentation.
The text was updated successfully, but these errors were encountered: