Unifying tool lockfiles and user lockfiles? #17776
Replies: 5 comments 4 replies
-
What I'd like to get to is to have one unified lockfile mechanism for tools and user lockfiles. Where you can even do things like resolve a tool from a user lockfile (e.g., pytest, which otherwise has to appear in both). |
Beta Was this translation helpful? Give feedback.
-
Note that this relates to this feature request: #17721. Implementing that, and other export-related features, would be substantually simpler if we could streamline tool lockfiles. |
Beta Was this translation helpful? Give feedback.
-
I think it would be great to unify the concepts of user and tool resolves (not sure if that's exactly the same as unifying the lockfile mechanism, or just very closely related). I have occasionally wanted to mark sources as belonging to a tool's resolve (i.e. to have in-repo |
Beta Was this translation helpful? Give feedback.
-
We are much closer to merging tool and user lockfiles. In 2.18.x, we finally removed support for using
What else is required to finish merging tool and user lockfiles? |
Beta Was this translation helpful? Give feedback.
-
This has been implemented. |
Beta Was this translation helpful? Give feedback.
-
Kicking off a thread to discuss how Python tool lockfiles are different from user lockfiles, and why, and whether we can simplify and unify these mechanisms.
This is particularly in relation to
export
, which currently requires a lot of jumping through hoops in order to support the--resolve=
flag uniformly for user and tool lockfiles.Basically, for a user lockfile it is easy to go from resolve name to lockfile content. But for a tool lockfile, we have to go via ExportPythonToolSentinel -> ExportPythonTool -> PexRequest
As far as I can tell, this is so that tools can tinker with the interpreter constraints in various ways. E.g.,
pants/src/python/pants/backend/python/lint/black/subsystem.py
Line 151 in 7251de9
But I'm wondering if this is strictly necessary? There are already interpreter constraints baked into the lockfile, and if the repo has custom interpreter constraints on the tool's subsystem then they must regenerate the lockfile anyway.
So a lot of complexity seems to exist only to support the feature of automatically adopting python3.8 interpreter constraints for black and mypy (and maybe there are other examples?) without forcing you to regenerate the 3.7+ lockfile we ship with. And I'm wondering if it's worth it. We could, for example, ship a python3.8+ tool lockfile, and if you must run on 3.7 then you must generate a tool lockfile?
But, I'm also wondering if I'm fully understanding this, and if I am missing more reasons why this complexity is needed. I have a feeling I'm not seeing the full picture.
Beta Was this translation helpful? Give feedback.
All reactions