cool-easter-32542
07/23/2024, 4:47 PMresource targets I load.
The solution
It would be nice to have the support implemented in rust.
Specifically, I want the anchor argument to work with an import:
import my_package
from importlib.resources import files
files(my_package).joinpath('path/to/my_resource.txt')
and `__package__`:
from importlib.resources import files
files(package).joinpath('path/to/my_resource.txt')
Alternatives
The support could be added in python, but it will be slow and it would duplicate the AST parsing and analysis.
pantsbuild/pants