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

install python modules in Terminal when python.installModulesInTerminal enabled #5529

Merged
merged 7 commits into from
Nov 27, 2024

Conversation

sharon-wang
Copy link
Member

@sharon-wang sharon-wang commented Nov 26, 2024

  • addresses Cannot see failures when installing ipykernel #5506
  • adds a new command python.installModulesInTerminal, that, when enabled, forces python installations to occur in the Terminal
    • this option is disabled by default
  • passes an otherwise unused cancellation token to the terminal service, which makes it so that the terminal execution must complete before the promise resolves
    • This might mean that we can opt to use the Terminal (and pass a cancellation token) in the places where we have the comment
            // Using a process to install modules avoids using the terminal service,
            // which has issues waiting for the outcome of the install.

QA Notes

When python.installModulesInTerminal is enabled, any flow that passes through the installModule() method should run the install command in a Terminal visible to the user. When the option is not enabled, python module installations should occur in the background, invisible to the user.

Project Wizard

  1. Create a Python or Jupyter project with Venv
  2. One of the new project initialization tasks should kick off the ipykernel install in a Terminal

Command Prompt

  1. Run the command Python: Create Environment
  2. Start the newly created interpreter
  3. Accept the ipykernel install
  4. See ipykernel install in a Terminal

Select interpreter that does not have ipykernel

  1. Select an interpreter from the Interpreter Dropdown or use the Python: Select Interpreter command that does not already have ipykernel installed
  2. Accept the ipykernel install
  3. See ipykernel install in a Terminal

adds a new command `python.installModulesInTerminal`, that, when enabled, forces python installations to occur in the Terminal.
@sharon-wang sharon-wang requested review from jmcphers and seeM November 26, 2024 23:24
jmcphers
jmcphers previously approved these changes Nov 27, 2024
Copy link
Collaborator

@jmcphers jmcphers left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM; confirmed that turning on this new setting lets me see the installs in a Terminal.

extensions/positron-python/package.json Outdated Show resolved Hide resolved
seeM
seeM previously approved these changes Nov 27, 2024
Copy link
Contributor

@seeM seeM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code changes LGTM!

@sharon-wang sharon-wang dismissed stale reviews from seeM and jmcphers via f3cd090 November 27, 2024 15:08
@sharon-wang sharon-wang requested review from seeM and jmcphers November 27, 2024 15:53
@sharon-wang sharon-wang merged commit 8c7b9a9 into main Nov 27, 2024
24 checks passed
@sharon-wang sharon-wang deleted the feature/force-python-install-terminal branch November 27, 2024 17:58
@github-actions github-actions bot locked and limited conversation to collaborators Nov 27, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants