Skip to content

Add shell argument to get_environment and apply #1928

Open
@triley13

Description

@triley13

Motivation
On windows, get_environ and apply methods on the ResolvedContext class take a very long time when resolving a powershell environment before the cached method.

Image

Explanation
This is because append_system_paths method on the Python interpreter creates a new shell from the config defaults. This method trickles up to the _execute method in the ResolvedContext class. Which is then called by apply and get_environ.

Additional Motivation
There are other methods on the ResolvedContext class that allows for using shells within the resolved context and would be nice to be able to carry this functionality over.

Proposed Solutions

  • Add a default shell on the Python interpreter class that can be used for Python shell environments when instantiating the executor.
  • Add a argument shell in the append_system_paths and the _execute functions to be passed down as default or override.

Current Workaround

config = create_config()
config.override("default_shell", "cmd")

context.get_environ()

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions