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

Test that UI indicates terminal activation when activating using environment variables #21298

Closed
13 of 17 tasks
karrtikr opened this issue May 25, 2023 · 11 comments
Closed
13 of 17 tasks

Comments

@karrtikr
Copy link

karrtikr commented May 25, 2023

Refs: #21793

Complexity: 5

Create Issue


Requirements

Similar to #21102 hence preassigning.

  • Python extension pre-release
  • Latest VSCode Insiders
  • Ability to create virtual environment
    • Use python -m venv <name> to create virtual envs.
  • Ability to create conda environment
  • Basic terminal shell types, please tick whatever is available in your OS:
    • Windows:
      • cmd
      • powershell
      • powershellcore
    • Linux:
      • bash
      • zsh
      • fish
    • macOS :
      • bash
      • zsh
  • Nice to have:
    • sh
    • ksh
    • csh
    • tcsh
    • nushell
    • xonsh

Verification

  • Add following to user settings and reload window:
"python.experiments.optInto": ["pythonTerminalEnvVarActivation"]
  • Run conda config --set auto_activate_base True.

  • Open a workspace folder and activate Python extension by opening a Python file.

  • Select a virtual environment using Python: Select Interpreter command.

  • Loop -> Do the following for all terminal shell types:

    • Open a new terminal.
    • Ensure we indicate the env is activated in at least one of the following ways:
    • Make sure terminal is activated using the selected environment. Run the following in terminal:
      python -c"import sys;print(sys.executable)"
      
    • Output should contain the path to interpreter selected. For eg. for .venv created via python -m venv .venv it looks something like:
      C:\Users\karraj\OneDrive - Microsoft\Desktop\folders\crap\.venv\Scripts\python.exe
      
    • Change the default shell in your OS using Terminal: Select Default Profile, say bash->fish
  • Select a conda environment using Python: Select Interpreter command and repeat the above loop.

  • If the notification was visible at some point:

    • Verify clicking "learn more" opens this wiki.
    • Verify that opening a new terminal after clicking "Don't show again" does not show the notification.
@github-actions github-actions bot added this to the May 2023 milestone May 25, 2023
@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2023
@karrtikr karrtikr reopened this May 26, 2023
@karrtikr

This comment was marked as outdated.

@karrtikr karrtikr closed this as not planned Won't fix, can't repro, duplicate, stale May 26, 2023
@karrtikr karrtikr removed this from the May 2023 milestone May 26, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jun 26, 2023
@karrtikr karrtikr changed the title Test multiroot support for terminal activation using environment variables Test terminal prompt for multiroot workspace when in pythonTerminalEnvVarActivation experiment Aug 14, 2023
@karrtikr karrtikr changed the title Test terminal prompt for multiroot workspace when in pythonTerminalEnvVarActivation experiment Test terminal prompt when activating terminals using environment variables Aug 14, 2023
@karrtikr karrtikr changed the title Test terminal prompt when activating terminals using environment variables Test that UI indicates terminal activation when activating using environment variables Aug 14, 2023
@karrtikr karrtikr added this to the August 2023 milestone Aug 14, 2023
@karrtikr karrtikr reopened this Aug 14, 2023
@ghost ghost assigned aiday-mar, amunger and lramos15 Aug 29, 2023
@amunger
Copy link

amunger commented Aug 29, 2023

This isn't working for me at all:

After running conda config --set auto_activate_base True, it always just activates the base conda environment, not the interpreter I have selected.

Before I ran that, the environment never activated, but I get the notification: #21887

@aiday-mar aiday-mar removed their assignment Aug 29, 2023
@eleanorjboyd eleanorjboyd assigned eleanorjboyd and unassigned amunger Aug 29, 2023
@eleanorjboyd
Copy link
Member

mine always says (base) PS C:\Users\eleanorboyd\testFilesWindows\conda-shell> is it ok that it says base and not .venv?

@karrtikr
Copy link
Author

Yes you can ignore that for now. Please run the Python command specified to see which environment is actually activated.

@karrtikr
Copy link
Author

karrtikr commented Aug 29, 2023

This isn't working for me at all:

Me and Aaron discussed here that it actually works: #21887 (comment), but it was the same confusion that @eleanorjboyd has, which is that it always shows (base) regardless of which env is actually activated.

Sorry for the trouble.

@lramos15
Copy link
Member

Is it standard for Python docs to be in a GH wiki. I'm wondering if this should be on the VS Code website so we can track things like page views?

@karrtikr
Copy link
Author

@lramos15 We have plans to move it there, but right now this is behind an experiment hence isn't applicable for everyone.

@eleanorjboyd eleanorjboyd removed their assignment Aug 29, 2023
@microsoft microsoft unlocked this conversation Aug 29, 2023
@lramos15 lramos15 removed their assignment Aug 29, 2023
@karrtikr
Copy link
Author

image

@lramos15 Were you able to test for zsh and fish on Linux?

@lramos15
Copy link
Member

image

@lramos15 Were you able to test for zsh and fish on Linux?

Oh I do not have those installed, do I need to install them for the TPI. I got confused by the wording please tick whatever is available in your OS which made me think it was test what you have.

@karrtikr
Copy link
Author

Sorry, if you could install them that would be great. Our codespaces already has it pre-installed so you can also use that, thanks!

@lramos15
Copy link
Member

Sorry, if you could install them that would be great. Our codespaces already has it pre-installed so you can also use that, thanks!

Done 👍

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

No branches or pull requests

5 participants