-
-
Notifications
You must be signed in to change notification settings - Fork 1k
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
Export VIRTUAL_ENV_PROMPT
in activation scripts (#2194)
#2606
Export VIRTUAL_ENV_PROMPT
in activation scripts (#2194)
#2606
Conversation
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.
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.
Please add extend the test suite to test for this.
VIRTUAL_ENV_PROMPT
in activation scripts (#2914)VIRTUAL_ENV_PROMPT
in activation scripts (#2194)
I'll take a look. I'm going to mark this as a draft for now until I get tests resolved (and ideally for my second |
@gaborbernat Ok, hopefully these tests pass. I had to make some educated guesses for a few of the shells. |
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.
You'll need to make the CI pass 😊
Will do. I'm working on fixing them on my fork right now (but in a separate branch to keep the noise of pushing to CI repeatedly down over here). I'll push to this branch once things look green. |
@gaborbernat Ok, I think these tests should be good now. One small note is that I renamed |
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.
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com) This PR contains the following updates: | Package | Change | Age | Adoption | Passing | Confidence | |---|---|---|---|---|---| | [virtualenv](https://togithub.com/pypa/virtualenv) | `==20.23.1` -> `==20.24.1` | [![age](https://developer.mend.io/api/mc/badges/age/pypi/virtualenv/20.24.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![adoption](https://developer.mend.io/api/mc/badges/adoption/pypi/virtualenv/20.24.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![passing](https://developer.mend.io/api/mc/badges/compatibility/pypi/virtualenv/20.23.1/20.24.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | [![confidence](https://developer.mend.io/api/mc/badges/confidence/pypi/virtualenv/20.23.1/20.24.1?slim=true)](https://docs.renovatebot.com/merge-confidence/) | --- ### Release Notes <details> <summary>pypa/virtualenv (virtualenv)</summary> ### [`v20.24.1`](https://togithub.com/pypa/virtualenv/releases/tag/20.24.1) [Compare Source](https://togithub.com/pypa/virtualenv/compare/20.24.0...20.24.1) <!-- Release notes generated using configuration in .github/release.yml at 20.24.1 --> ##### What's Changed - release 20.24.0 by [@​gaborbernat](https://togithub.com/gaborbernat) in [https://github.com/pypa/virtualenv/pull/2608](https://togithub.com/pypa/virtualenv/pull/2608) - Upgrade `pip` by [@​arielkirkwood](https://togithub.com/arielkirkwood) in [https://github.com/pypa/virtualenv/pull/2611](https://togithub.com/pypa/virtualenv/pull/2611) ##### New Contributors - [@​arielkirkwood](https://togithub.com/arielkirkwood) made their first contribution in [https://github.com/pypa/virtualenv/pull/2611](https://togithub.com/pypa/virtualenv/pull/2611) **Full Changelog**: pypa/virtualenv@20.24.0...20.24.1 ### [`v20.24.0`](https://togithub.com/pypa/virtualenv/releases/tag/20.24.0) [Compare Source](https://togithub.com/pypa/virtualenv/compare/20.23.1...20.24.0) <!-- Release notes generated using configuration in .github/release.yml at 20.24.0 --> #### What's Changed - release 20.23.1 by [@​gaborbernat](https://togithub.com/gaborbernat) in [https://github.com/pypa/virtualenv/pull/2590](https://togithub.com/pypa/virtualenv/pull/2590) - Fix the CI by [@​gaborbernat](https://togithub.com/gaborbernat) in [https://github.com/pypa/virtualenv/pull/2593](https://togithub.com/pypa/virtualenv/pull/2593) - Quickstart guide by [@​AlvesJorge](https://togithub.com/AlvesJorge) in [https://github.com/pypa/virtualenv/pull/2599](https://togithub.com/pypa/virtualenv/pull/2599) - Updated CLI documentation with config file name by [@​nathanczh](https://togithub.com/nathanczh) in [https://github.com/pypa/virtualenv/pull/2602](https://togithub.com/pypa/virtualenv/pull/2602) - Exclude dependabot and pre-commit ci from release notes by [@​gaborbernat](https://togithub.com/gaborbernat) in [https://github.com/pypa/virtualenv/pull/2603](https://togithub.com/pypa/virtualenv/pull/2603) - Export `VIRTUAL_ENV_PROMPT` in activation scripts ([#​2194](https://togithub.com/pypa/virtualenv/issues/2194)) by [@​jimporter](https://togithub.com/jimporter) in [https://github.com/pypa/virtualenv/pull/2606](https://togithub.com/pypa/virtualenv/pull/2606) - Upgrade setuptools by [@​gaborbernat](https://togithub.com/gaborbernat) in [https://github.com/pypa/virtualenv/pull/2607](https://togithub.com/pypa/virtualenv/pull/2607) #### New Contributors - [@​AlvesJorge](https://togithub.com/AlvesJorge) made their first contribution in [https://github.com/pypa/virtualenv/pull/2599](https://togithub.com/pypa/virtualenv/pull/2599) - [@​nathanczh](https://togithub.com/nathanczh) made their first contribution in [https://github.com/pypa/virtualenv/pull/2602](https://togithub.com/pypa/virtualenv/pull/2602) - [@​jimporter](https://togithub.com/jimporter) made their first contribution in [https://github.com/pypa/virtualenv/pull/2606](https://togithub.com/pypa/virtualenv/pull/2606) **Full Changelog**: pypa/virtualenv@20.23.1...20.24.0 </details> --- ### Configuration 📅 **Schedule**: Branch creation - "every weekend" in timezone Etc/UTC, Automerge - "before 07:00" in timezone Etc/UTC. 🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied. ♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox. 🔕 **Ignore**: Close this PR and you won't be reminded about this update again. --- - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box --- This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/canonical/charmcraft). <!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi44LjExIiwidXBkYXRlZEluVmVyIjoiMzYuMTEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4ifQ==--> Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
And ignore VIRTUAL_ENV_PROMPT variable for now as it is different between venv and virtualenv implementations: * python/cpython#106726 * pypa/virtualenv#2606
See issue #2194. This change exports a
VIRTUAL_ENV_PROMPT
environment variable during venv activation so that users can use this in their own custom shell prompts if they like.I didn't add a test for this since I don't see any similar tests, and I'm not quite sure the bet way to go about writing one...I manually tested these changes in Bash and the results look good to me, though my changes for the other shell scripts are speculative. I did my best to guess how they should work, but there may be bugs!
Thanks for contributing, make sure you address all the checklists (for details on how see development documentation)
tox -e fix
)docs/changelog
folder