ambitious-student-81104
07/11/2022, 4:34 PMresolve
respect filesystem hierarchy? e.g. if I have something like this:
BUILD(a)
...
foo/
BUILD(b)
...
If I specify in BUILD(a)
:
python_sources(resolve="my-resolve")
but don’t specify a resolve in BUILD(b)
, does it / can we make it follow what’s in BUILD(a)
by default?bitter-ability-32190
07/11/2022, 4:38 PMpython_sources
only applies to its generated targets, AND `pyhthon_sources`'s default field value for sources
isn't recursive.
So, python_sources
has metadata only for this directory unless told otherwise.
You could switch the sources
field to be recursive (although there are drawbacks)
python_soureces(
# Not quite right, but you get the idea
sources=["**/*.py"],
...
)
Or eagerly await __defaults__
(here's the markdown documentation for this upcoming feature in 2.14) https://github.com/pantsbuild/pants/pull/15836/files#diff-f75e89f4936a42076eaf07a1a288169b36290b60b9095bb6a01cf22b95adf5e6__defaults__
feature is our first giant leap on the path to less metadata, and specifically leaning in to hierarchical metadata.ambitious-student-81104
07/11/2022, 4:43 PM./pants generate-lockfiles
ignore a requirements file?bitter-ability-32190
07/11/2022, 4:44 PMwitty-crayon-22786
07/11/2022, 4:52 PMambitious-student-81104
07/11/2022, 4:53 PMwitty-crayon-22786
07/11/2022, 4:54 PMtailor
not to recreate it?ambitious-student-81104
07/11/2022, 5:02 PM"--python-requirement-constraints"
./pants generate-lockfiles
we will still have to create multiple resolves?witty-crayon-22786
07/11/2022, 5:04 PMconstraints
in one of the runs) if you just marked the file as being in a separate resolve, but not the tests.ambitious-student-81104
07/11/2022, 5:05 PMyou could probably continue to run pants twice (and usebut the tests will depend on the target of thein one of the runs) if you just marked the file as being in a separate resolve, but not the tests.constraints
constraints
so they’d have to be in the save resolve, don’t they?witty-crayon-22786
07/11/2022, 5:08 PMambitious-student-81104
07/11/2022, 5:09 PM./pants generate-lockfiles
with the default resolve successfully run, while the test code is also in the default resolve, but the requirements target is in a separate resolveconstraints
file requirements target, how can ./pants generate-lockfiles
succeed? doesn’t it figure that the test code depends on that constraints file? which is inconsistent with the fact that the constraints target is in a different resolve?./pants generate-lockfiles
only look at the requirements that are used in targets in this resolve?witty-crayon-22786
07/11/2022, 5:12 PMor doescorrect: all of the requirements targets which are labeled with a resolve are used in the lockfile, but no source targets matteronly look at the requirements that are used in targets in this resolve?./pants generate-lockfiles
ambitious-student-81104
07/11/2022, 5:18 PM