Skip to content

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

Description

@karrtikr

#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

Metadata

Assignees

No one assigned

    Labels

    area-environmentsFeatures relating to handling interpreter environmentsdebtCode quality issuesfeature-requestRequest for new features or functionality

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions