bitter-ability-32190
04/08/2022, 4:35 PM[python-infer].assets
.
• Run test
• test fails "No such resource: XYZ"
• Add relevant BUILD.pants
• test succeeds
No need to declare the overrides: {"filename.py": dependencies: ["resourcepath1", "resourcepath2"]}
😈high-yak-85899
04/08/2022, 4:37 PMpathlib.Path(__file__)
and potentially some form of .parent
or .parents
and get the necessary resource/file.bitter-ability-32190
04/08/2022, 4:38 PMbitter-ability-32190
04/08/2022, 4:39 PMresources
relative tot he files' parent or files
relative to build root.high-yak-85899
04/08/2022, 4:40 PMbitter-ability-32190
04/08/2022, 4:41 PMpkgutil.get_data("data/foo.txt")
would be inferred if there's a resource at __file__ / ".." / "data" / "foo.txt"
hundreds-father-404
04/08/2022, 5:21 PM