hey I think I’m a little bit confused about the co...
# general
w
hey I think I’m a little bit confused about the correct usage of
files
and `resources`… I have a file that I sort of expected to live at the “root” of my temp pants folder but when I check under
.pants.d/pyprep….
it actually creates the full path… I mean I can change how I load the file but I thought
files
would put it as a loose file with the rest of the test files and
resources
would keep the whole path
w
resources
are relative to the nearest source root: https://www.pantsbuild.org/v1.30/docs/source-roots
files
are currently always relative to the buildroot
it’s possible that the relativeness of
files
will change as part of https://github.com/pantsbuild/pants/issues/10733… the current behavior was mostly based on
files
only being consumed by test targets. if they’re also consumed by the replacement for
app
as described there, then the semantics should probably change a bit.
resources
are relative because they are loaded via the python module system, uniformly across tests and runtime
w
👍 now it makes more sense, thanks!
❤️ 1