-
Notifications
You must be signed in to change notification settings - Fork 295
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
Investigate a method to create or suggest a virtual environment with ipykernel
+ needed packages for a given notebook
#9640
Comments
Here is a summary of the customer flow from the PPT slides on getting started env setup.
|
Options (in progress):
|
MVP Plan (in progress): What can we hash out in a few days of work that move us forward here and answer some questions. Trigger - None |
Consider adding a revisitation of whether we install ipykernel without asking to the work here. One idea that is an alternative to just installing would be to create a cell within the notebook that installs ipykernel for the user. That way they can see what needs to happen and allow it or not. Of course, this would need to be some sort of special case cell. The point is that we have been concerned that users won't like the idea of just having an environment get updated with a package they may not understand the need for and rather than prompting them, is there a more subtle way to ensure the right thing AND right education happens. |
Flow for when our command is visibleThis scenario is for picking when we should display our env creation command in the kernel picker. Note this is explicitly checking the pip/venv use case. And early second experimentation step will be adding in Conda support as well. Some cases (such as using Micromamba for installs instead of installed python) are out of current experiment scope. flowchart LR
start([VS Code Opens])
endYes([Show the env command in kernel picker])
endNo([Don't show the command])
fileOpen{Is a notebook file active?}
pythonAvailable{Is python available?}
globalOnly{Are all python controller global?}
havePip{Is pip/venv available?}
start-->fileOpen
fileOpen-- No -->fileOpen
fileOpen-- Yes -->pythonAvailable
pythonAvailable-- Yes -->globalOnly
pythonAvailable-- No -->endNo
globalOnly-- No -->endNo
globalOnly-- Yes -->havePip
havePip-- No -->endNo
havePip-- Yes -->endYes
Flow for when our command is executedflowchart TD
start([Env creation command is selected])
multiplePythons{Are there multiple pythons found?}
pythonPrompt[/Select PYTHON to use. QuickInput /]
createVenv[Create a .venv in the workspace]
installIPyKernel[Install ipykernel into venv]
hasRequirementsTxt{Workspace has requirements.txt file?}
collectRequirements[Collect PACKAGES from requirements]
hasImports{Active notebook document exists and has imports?}
collectImports[Collect PACKAGES from notebook document]
installPackages[Install PACKAGES if specified]
installPrompt[/Prompt user for installing PACKAGES with PYTHON. Modal/]
selectController[Select the created env as active controller]
start-->multiplePythons
multiplePythons-- Yes -->pythonPrompt
pythonPrompt-->hasRequirementsTxt
multiplePythons-- No -->hasRequirementsTxt
hasRequirementsTxt-- Yes -->collectRequirements
hasRequirementsTxt-- No -->hasImports
collectRequirements-->installPrompt
hasImports-- Yes -->collectImports
hasImports-- No -->installPrompt
collectImports-->installPrompt
installPrompt-->createVenv
createVenv-->installIPyKernel
installIPyKernel-->installPackages
installPackages-->selectController
Rough plan
Open questions
|
My takeaways per our quick sync today
A few other open questions
And another quick thought
|
Possible flow for Conda => Workspace association. Since we can't just use folder location like with venv instead keep a workspace => env mapping. If you have previously mapped this workspace to a named conda env, use that. If not, allow the create option. Only before creating, the first option is just to select and existing named Conda env. If that is not the one you want, allow a create option. |
Note current flow like so for venv. Note a few things:
EditCreateEnv.mp4 |
A couple more small flow videos with Conda added. Note to not worry too much about UI polish on this still, that side is coming from #11077. Note that progress bars are terrible and double entries in the existing conda list. Also for the video I did some serious shortening of the time sequences (conda env creation takes well > 1 min just by itself, and then 20s or so to connect). Pick an existing global conda environment: CondaExistingEnvEdit.mp4Create a new global conda environment: CondaCreateEnvEdit.mp4I consider these more proof of concept for the following:
|
Closing as python extension provides this. |
No description provided.
The text was updated successfully, but these errors were encountered: