Skip to content

Change default of interpreter path setting from "python" to "default"/"auto" #20460

Open
@karrtikr

Description

#20457 (comment)

This enables users to select "python" as an interpreter similar to how they can select "python3" or the like.

  • Change default of python.defaultInterpreterPath setting.
  • Change all the places in the extension that assumes default is "python". For eg. check these files
    • !workspaceFolderSetting?.value || workspaceFolderSetting?.value === 'python'
      ? defaultInterpreterPath.workspaceFolderValue
      : workspaceFolderSetting.value,
      workspaceValue:
      !workspaceSetting?.value || workspaceSetting?.value === 'python'
      ? defaultInterpreterPath.workspaceValue
      : workspaceSetting.value,
      };
      }
      public get(resource: Resource): string {
      const settings = this.inspect(resource);
      const value =
      settings.workspaceFolderValue ||
      settings.workspaceValue ||
      settings.globalValue ||
      (isTestExecution() ? CI_PYTHON_PATH : 'python');
    • (this.pythonPath.length === 0 || this.pythonPath === 'python') &&
    • if (!pythonPath || pythonPath === 'python') {
      // If python path wasn't passed in, we need to auto select it and then read it
      // from the configuration.
      const interpreterPath = this.interpreterPathExpHelper.get(options.resource);
      if (!interpreterPath || interpreterPath === 'python') {
    • export const DEFAULT_INTERPRETER_SETTING = 'python';
    • ... and more
  • Make sure any external API consumers relying on this fact are notified.

Metadata

Assignees

No one assigned

    Labels

    area-environmentsFeatures relating to handling interpreter environmentsdebtCovers everything internal: CI, testing, refactoring of the codebase, etc.feature-requestRequest for new features or functionalityneeds PRReady to be worked on

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions