Skip to content
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

pex3 venv create accepts --bin-path but does not omit __main__.py #2144

Open
zmanji opened this issue May 2, 2023 · 3 comments
Open

pex3 venv create accepts --bin-path but does not omit __main__.py #2144

zmanji opened this issue May 2, 2023 · 3 comments

Comments

@zmanji
Copy link
Collaborator

zmanji commented May 2, 2023

pex3 venv create in 2.1.135 accepts a --bin-path argument but does not populate a __main__.py in the root of the venv so it does nothing. To fix this we can remove it from the args list or adjust pex3 venv create to write the __main__.py in the root of the venv.

@jsirois
Copy link
Member

jsirois commented May 2, 2023

I could document things better, but several of the options don't really make sense unless the venv is built from a --pex-repository (--bin-path and --scope come to mind). What exactly are you trying to do?

@zmanji
Copy link
Collaborator Author

zmanji commented May 2, 2023

I could document things better, but none of those options really make sense unless the venv is built from a --pex-repository. What exactly are you trying to do?

It was my understanding the produced __main__.py would add the bin/ directory to the PATH before launching the interpreter or console script as well as set the VIRTUAL_ENV environment variable like the activate script. I was using it as a slightly nicer activate script.

It's not something I really relied on however and I think just following up with a documentation change for the next release would be the right thing to do since it is a slight divergence from running PEX_TOOLS=1 ./my.pex venv -b prepend -f ./venv.

@jsirois
Copy link
Member

jsirois commented May 2, 2023

Ok, thanks - that helps. Yeah, the idea is a normal venv via requirements or from a --lock is just a normal venv.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants