https://pantsbuild.org/ logo
c

calm-ambulance-65371

12/10/2020, 4:54 PM
Does Pants make any guarantees about runtime directory relative to the source tree? Particularly in regards to relative path between some
python_tests
and
resources
?
h

hundreds-father-404

12/10/2020, 5:25 PM
Yes. It strips the source root, if any. See https://www.pantsbuild.org/docs/resources For tests, it's also often convenient to use files() or relocated_files() instead
h

happy-kitchen-89482

12/10/2020, 7:29 PM
resources
are intended to be loaded via pkg_resources mechanisms, using logical names relative to the source root.
files
are just files, relative to the repo root, but you can relocate them (logically) at runtime, as Eric mentioned.
Is there a specific example we can weigh in on? 🙂
3 Views