-
-
Notifications
You must be signed in to change notification settings - Fork 258
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
Support --project
locking and PEX building.
#2455
Conversation
Although Pex already supported local project requirements, they worked like any other requirement and were included in locks. In the typical case, a project would rather maintain a lock of its third party requirements separate from itself. For projects that used requirement files to record their unlocked dependencies, `-r` could be used instead of locking the local project. For projects that recorded their dependencies in a `setup.py`, `setup.cfg` or `pyproject.toml`, the dependency information needed to be extracted from those files to create a lock that did not lock the project code itself. Just as bad, when constructing a PEX the source code layout of the project recorded in those same project files needed to be replicated in some combination of `-D`, `-P` and `-M` since resolving from a lock required all projects needed by the PEX were represented in the lock. With the addition of the new `--project` option to PEX builds and `pex3 lock {create,sync}`, a project's dependencies and source code layout can be referenced from their canonical home in the project configuration files. Fixes pex-tool#2412.
Previously timings could be dropped.
Previously, if a PEX was built and run on the same machine, later PEXes built from the same wheels would have `.pyc` from prior runs of that wheel code erroneously included, breaking the `--no-compile` default as well as reproducibility.
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.
I noticed dropped timings for the new TRACER.timed("Collecting requirements from {count} local {projects}")
added to pex/cli/commands/lock.py
.
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.
I had actually seen this .pyc
leak before in scie-pants, but also encountered it in the integration test here comparing PEX files.
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.
Great!
--project
locking and PEX building.
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.
Great!
Although Pex already supported local project requirements, they worked
like any other requirement and were included in locks. In the typical
case, a project would rather maintain a lock of its third party
requirements separate from itself. For projects that used requirement
files to record their unlocked dependencies,
-r
could be used insteadof locking the local project. For projects that recorded their
dependencies in a
setup.py
,setup.cfg
orpyproject.toml
, thedependency information needed to be extracted from those files to create
a lock that did not lock the project code itself. Just as bad, when
constructing a PEX the source code layout of the project recorded in
those same project files needed to be replicated in some combination of
-D
,-P
and-M
since resolving from a lock required all projectsneeded by the PEX were represented in the lock.
With the addition of the new
--project
option to PEX builds andpex3 lock {create,sync}
, a project's dependencies and source codelayout can be referenced from their canonical home in the project
configuration files.
Fixes #2412.