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
gh-89427: Provide the original prompt value for VIRTUAL_ENV_PROMPT #106726
gh-89427: Provide the original prompt value for VIRTUAL_ENV_PROMPT #106726
Conversation
858a810
to
41800a3
Compare
41800a3
to
d65e6ee
Compare
f1fbcfd
to
e676da1
Compare
@vsajip Is there anything else I should do with this patch before it merges? This change will keep venv's behavior in-sync with virtualenv (see pypa/virtualenv#2606). |
Sorry, not had time to review this. Hope to get to it soon. |
No problem! Just wanted to make sure you weren't waiting on me for something. |
e676da1
to
980d15d
Compare
@vsajip I rebased this and fixed the merge conflicts, which had the nice benefit of actually making the diff smaller. |
This improves the implementation in gh-106643. Previously, venv passed "(<prompt>) " to the activation scripts, but we want to provide the original value so that users can inspect it in the $VIRTUAL_ENV_PROMPT env var. Note: Lib/venv/scripts/common/Activate.ps1 surrounded the prompt value with parens a second time, so no change was necessary in that file.
980d15d
to
d658e85
Compare
@vsajip Just checking again to see if you have bandwidth to review. I rebased again so it should merge cleanly. |
…MPT (pythonGH-106726) This improves the implementation in pythongh-106643. Previously, venv passed "(<prompt>) " to the activation scripts, but we want to provide the original value so that users can inspect it in the $VIRTUAL_ENV_PROMPT env var. Note: Lib/venv/scripts/common/Activate.ps1 surrounded the prompt value with parens a second time, so no change was necessary in that file.
This improves the implementation in gh-106643.
Previously, venv passed
"(<prompt>) "
to the activation scripts, but we want to provide the original value so that users can inspect it in the$VIRTUAL_ENV_PROMPT
env var.Note: Lib/venv/scripts/common/Activate.ps1 surrounded the prompt value with parens a second time, so no change was necessary in that file.
Sorry for the noise; I didn't quite understand the flow of this code until I started comparing it more closely to the implementation in the
virtualenv
package.I was careful to test this change in action (only using the Bash version of the activation script, since that's the shell I have), but I also checked the generated scripts and they all look correct to me. After calling
python -m venv foobar
(results are also as expected if I pass--prompt=something
):activate
activate.csh
activate.fish