https://pantsbuild.org/ logo
#general
Title
# general
r

ripe-gigabyte-88964

03/17/2023, 2:37 PM
Potentially dumb question but how do I only regenerate lockfiles for resolves that have been updated?
n

nice-park-16693

03/17/2023, 2:44 PM
new here but I'll try answering with my limited knowledge rather than just asking for a change 🙂 I've found a manual way of doing this via
Copy code
pants generate-lockfiles --generate-lockfiles-resolve="['resolve_1', 'resolve_2']"
I haven't yet found a more automated way -- for example, something that could look at unstaged changes or changes between two revisions and regenerate only lockfiles for affected resolves.
❤️ 1
c

curved-television-6568

03/17/2023, 2:58 PM
there are no dumb questions.. we all had to learn the basics or not so basics at some point. there’s no out-of-the box way to do it, but if you’re up for some mechanics you could do it with:
Copy code
$ pants peek --filter-target-type=python_requirement --changed-dependents=transitive --changed-since=main | jq -r '.[] | .resolve // "python-default"' | sort | uniq
python-default
then use that as input for the next step
Copy code
$ pants generate-lockfiles --resolve=...
(note: you can omit the goal name from the option when used after the goal on the command line as the scope will be inferred..)
🎉 2
2 Views