pantsbuild: Generate PEX lockfile for st2#5830
Merged
cognifloyd merged 3 commits intomasterfrom Dec 2, 2022
Merged
Conversation
cognifloyd
commented
Dec 2, 2022
| ] | ||
|
|
||
| [python] | ||
| # resolver_version is always "pip-2020-resolver". legacy is not supported. |
Member
Author
There was a problem hiding this comment.
Our current infra relies on the legacy resolver and old versions of pip. Old versions of pants also supported the older pip + legacy resolver, but the version we're using now does not.
So, I left this comment here for future reference and to call out this departure from how we used to do things.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Background
This is another part of introducing pants, as discussed in various TSC meetings.
Related PRs can be found in:
Overview of this PR
This introduces a lockfile for our 3rd party dependencies (based on dependencies/constraints from #5789 and python constraints from #5795).
To create this lockfile, we need to register a "resolve" (called "st2") in pants, which represents the wold of direct and transitive dependencies required by our code. We also register the dependency constraints file added in #5789.
Finally, we create the lockfile by running
./pants generate-lockfiles --resolve=st2.Note that the lockfile has 4840 lines. Beyond that this PR only:
pants.tomlCHANGELOG.rstRelevant Pants documentation
pants.tomloptions:[python].enable_resolves = <bool>[python.resolves].<resolve name> = "<lockfile path>"[python].default_resolve = "<resolve name>"[python.resolves_to_constraints_file].<resolve name> = "<constraints file path>"Resolves and Lockfiles
Pants has multiple resolves, where a resolve represents the world of dependencies for some tool or code. Each resolve can have a lockfile associated with it. All tools (like black, flake8, etc) have lockfiles by default, but first-party code only gets a lockfile if we enable resolves and add a lockfile for it. So, we:
[python].enable_resolves = trueinpants.toml;[python].default-resolve = "st2";[python.resolves].st2 = "lockfiles/st2.lock"; and[python.resolves_to_constraints_file].st2 = "lockfiles/st2-constraints.txt".Finally, generate the lockfile with
./pants generate-lockfiles --resolve=st2.We can also regenerate all lockfiles (st2 and tools) with
./pants generate-lockfiles.