Skip to content

Investigate the possible flow for a Create Environment command #19676

Closed

Description

This would be taking the ideas from WWBD and bringing them here.

Activity

  1. brettcannon commented on Aug 11, 2022

    @brettcannon
    MemberAuthor
    flowchart TD
        start([start])
    
        has_interpreter{Interpreter selected?}
        has_env_selected{Environment selected?}
        has_python{Is Python installed?}
        select_newest[Select newest Python]
        has_venv{Has `venv`?}
        create_env[`python -m venv .venv`]
    
        has_pip{"Has `pip`?"}
        
        has_requirements{Has requirements files?}
        select_requirements[/Select requirements files/]
        install_requirements["`python -m pip install -r requirements.txt`"]
    
        has_pyproject{Has a `pyproject.toml`?}
        select_extras[/Select extras/]
        install_extras["`python -m pip install -e .[extras]`"]
    
        error((Notify user of problem))
    
        finished([end])
        
    
        start --> has_interpreter
    
        subgraph Create Environment
    
        has_interpreter -- yes --> has_venv
        has_interpreter -- no --> has_env_selected
    
        %% error
        has_env_selected -- "no (nothing selected)" --> has_python
    
        has_python -- yes --> select_newest
        %% error
        
    
        select_newest --> has_venv
    
        has_venv -- yes --> create_env
        %% error
        end
    
        subgraph Installation
        create_env --> has_pip
    
        has_pip -- yes --> has_requirements
        %% error
        
        has_requirements -- yes --> select_requirements
        select_requirements --> install_requirements
        %% finished
        has_requirements -- no --> has_pyproject
    
        has_pyproject -- yes --> select_extras
        select_extras --> install_extras
        %% finished
        end
    
        has_venv -- "no (Debian)" --> error
        has_python -- no --> error
        has_env_selected -- yes --> error
        has_pip -- "no (Debian)" --> error
    
        error --> finished
        install_extras --> finished
        has_pyproject -- no --> finished
        install_requirements --> finished
    
    Loading
  2. brettcannon commented on Aug 11, 2022

    @brettcannon
    MemberAuthor
  3. karthiknadig commented on Aug 12, 2022

    @karthiknadig
    Member

    If we are triggering environment creataion, we should probably skip the popup that we show when we detect env creation.

  4. brettcannon commented on Aug 15, 2022

    @brettcannon
    MemberAuthor

    If we are triggering environment creataion, we should probably skip the popup that we show when we detect env creation.

    We should probably skip it regardless and just select the environment with an option to turn off automatic environment detection/selection.

  5. karthiknadig commented on Sep 16, 2022

    @karthiknadig
    Member

    For now the flow is like this:

    1. User execute the create environment command.
    2. We show a Quick pick allowing users to select from one of the providers (venv / conda / etc)
    3. For venv :
      1. Select a workspace in multi root scenario. If single workspace this is not shown.
      2. Select a python from a list of global pythons (This required exposing the python picker as an internal API). If only one interpreter is found, then that is used.
      3. Initiate the command to create venv. Install any packages.
    4. For conda:
      1. Select a workspace in multi root scenario. If single workspace this is not shown.
      2. Select a version of python to install in the new environment.
      3. Initiate the command to create conda env using --prefix.
    5. Once env is created you will see a pop-up to select that env (this is temporary until we expose a way to pause that UI)
  6. added a commit that references this issue on Sep 23, 2022
    192c3ea
  7. brettcannon commented on Sep 27, 2022

    @brettcannon
    MemberAuthor

    3. Install any packages.

    Which install scenarios are supported?

  8. karthiknadig commented on Sep 27, 2022

    @karthiknadig
    Member

    Which install scenarios are supported?

    requirements.txt or pyproject.toml directly under the workspace directory is supported.

  9. added a commit that references this issue on Oct 4, 2022
    1dbc9c8
  10. locked as resolved and limited conversation to collaborators on Oct 28, 2022
  11. added a commit that references this issue on Mar 28, 2024
    50e3c9c
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Labels

area-environmentsFeatures relating to handling interpreter environmentsfeature-requestRequest for new features or functionalityneeds proposalNeed to make some design decisionson-testplanAdded to test plan

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions