-
-
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
Pex should support creating a venv directly #1752
Comments
Although you can command line golf today:
I agree this would be useful. Your suggestion of |
FWIW @zmanji the new |
This allows creating venvs (or updating existing ones) directly from locks or subsets of locks. Fixes pex-tool#1752
I ended up providing |
This command allows inspecting venvs created by Pex as well as those created by other tools. Work towards pex-tool#1752 and pex-tool#2110
This code as well as selection of a unique target to resolve for will be re-used by the forthcoming `pex3 venv create` command. Along the way, clean up confusion noted in pex-tool#2135 in the introduction of the `pex3 venv` subcommand surrounding `pyvenv.cfg` files generated by `Virtualenv`. Work towards pex-tool#1752 and pex-tool#2110.
This code as well as selection of a unique target to resolve for will be re-used by the forthcoming `pex3 venv create` command. Along the way, clean up confusion noted in #2135 in the introduction of the `pex3 venv` sub-command surrounding `pyvenv.cfg` files generated by `Virtualenv`. Work towards #1752 and #2110.
This new subcommand can create either a venv or just populate a flat `sys.path` directory entry (ala `pip install --target`) given a set of requirements to resolve, potentially from a lock or an existing PEX file, but otherwise from indexes and find links repos. Unlike the sibling `venv` `pex-tool` subcommand, the target can be selected and, in the flat `sys.path` directory entry case, it can be a foreign platform. Fixes pex-tool#1752 Fixes pex-tool#2110
This new subcommand can create either a venv or just populate a flat `sys.path` directory entry (ala `pip install --target`) given a set of requirements to resolve, potentially from a lock or an existing PEX file, but otherwise from indexes and find links repos. Unlike the sibling `venv` `pex-tool` subcommand, the target can be selected and, in the flat `sys.path` directory entry case, it can be a foreign platform. Fixes pex-tool#1752 Fixes pex-tool#2110
This new sub-command can create either a venv or just populate a flat `sys.path` directory entry (ala `pip install --target`) given a set of requirements to resolve, potentially from a lock or an existing PEX file, but otherwise from indexes and find links repos. Unlike the sibling `venv` `pex-tool` sub-command, the target can be selected and, in the flat `sys.path` directory entry case, it can be a foreign platform. Fixes #1752 Fixes #2110 Fixes #2111
With the lockfile and venv features it's very easy now to create reproducible venvs with pex. It's very handy for setting up development environments without Docker and you can ensure all of the dependencies are wheels and not sdists.
I have been doing this:
pex3 lock create
. This lockfile contains the resolves for all third party dependencies for all platforms I care about. I can use--no-build
to ensure all of the dependencies are wheels.pex --lock pex.lock --venv -o depencies.pex
PEX_TOOLS=1 ./dependencies.pex venv ./venv
PEX_EXTRA_SYS_PATH='./srcs' ./out.pex.venv/pex -m 'mymodule'
. In my casesrcs
contains multiple packages.I install the virtualenv for two reasons:
I think pex should be able to collapse steps 2 and 3 above into a single command invocation. I would envision something like:
The text was updated successfully, but these errors were encountered: