-
-
Notifications
You must be signed in to change notification settings - Fork 745
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
pantsbuild: Generate PEX lockfile for st2 #5830
Conversation
@@ -85,12 +85,23 @@ root_patterns = [ | |||
] | |||
|
|||
[python] | |||
# resolver_version is always "pip-2020-resolver". legacy is not supported. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Woohoo!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
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.toml
CHANGELOG.rst
Relevant Pants documentation
pants.toml
options:[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 = true
inpants.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
.