best-florist-45041
12/17/2021, 1:04 AM3rdparty/requirements.txt
file with the python_requirements()
in the BUILD sister file.
so, for example:
❯ ./pants dependencies 3rdparty:boto3
3rdparty:requirements.txt
Now suppose I change the version of boto3 in requirements.txt
.
./pants list --changed-since=HEAD --changed-dependees=transitive
will return, well, basically everything. One some level this makes sense (everything has a 3rd party requirement), but how can I filter on just those files that are affected by the change to that single requirement?happy-kitchen-89482
12/17/2021, 3:29 AMhappy-kitchen-89482
12/17/2021, 3:43 AMhappy-kitchen-89482
12/17/2021, 3:44 AMgit diff -U0 | grep -E -o "^[-+]\w+" | sed 's/^./3rdparty:/g' | sort | uniq
happy-kitchen-89482
12/17/2021, 3:47 AMhappy-kitchen-89482
12/17/2021, 3:47 AMgit diff -U0 | grep -E -o "^[-+]\w+" | sed 's/^./3rdparty:/g' | sort | uniq | \
xargs ./pants dependees --transitive
happy-kitchen-89482
12/17/2021, 3:47 AMbest-florist-45041
12/17/2021, 4:16 AMrequirements.txt
into the individual python_requirement(...)
targets.
More generally, can pants
compute two subgraph of targets, using the same specification but for two different git revisions. And then compute the diff?happy-kitchen-89482
12/17/2021, 5:41 AMcurved-television-6568
12/17/2021, 6:02 AMbest-florist-45041
12/17/2021, 5:57 PM--changed-since
is merely a file selector, and one can only pivot from that to asking what targets are impacted by those files having been changed. Probably my point of view is a lot more work to implement 🙂
I thought I could solve this by listing everything in requirements.txt
individually as a python_requirement(...)
in the sister BUILD file. Alas it does not for the above reasons.
I'll have to think a bit more about what the desired behavior is here, and perhaps try writing a plugin if that appears doable.happy-kitchen-89482
12/17/2021, 6:49 PMhappy-kitchen-89482
12/17/2021, 6:49 PMenough-analyst-54434
12/17/2021, 7:00 PMgit clone --reference
or git clone --shared
into another spot and operate against that to get this info if we wanted to go down that route.curved-television-6568
12/17/2021, 7:53 PMbest-florist-45041
12/18/2021, 11:25 PMcurved-television-6568
12/19/2021, 8:25 AMhappy-kitchen-89482
12/20/2021, 3:57 AMbest-florist-45041
12/20/2021, 7:46 PM--changed-since
, or at least be another option like --changed-since-exact
. If you all agree, and think the road there doesn't require a major overhaul, I'd be happy to take a pass at implementation.