Skip to content
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

Add option for pyenv interpreters when creating environments with venv #21219

Merged
merged 3 commits into from
May 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,8 @@ export class VenvCreationProvider implements CreateEnvironmentProvider {
EnvironmentType.System,
EnvironmentType.MicrosoftStore,
EnvironmentType.Global,
].includes(i.envType),
EnvironmentType.Pyenv,
].includes(i.envType) && i.type === undefined, // only global intepreters
{
skipRecommended: true,
showBackButton: true,
Expand Down
4 changes: 3 additions & 1 deletion src/client/pythonEnvironments/info/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,11 @@ export type InterpreterInformation = {
*
* @prop companyDisplayName - the user-facing name of the distro publisher
* @prop displayName - the user-facing name for the environment
* @prop type - the kind of Python environment
* @prop envType - the kind of Python environment
* @prop envName - the environment's name, if applicable (else `envPath` is set)
* @prop envPath - the environment's root dir, if applicable (else `envName`)
* @prop cachedEntry - whether or not the info came from a cache
* @prop type - the type of Python environment, if applicable
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@karrtikr is this supposed to indicate virtual vs global?

Copy link

@karrtikr karrtikr May 12, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, all these old types will go away with #20240 so I'm not too worried.

*/
// Note that "cachedEntry" is specific to the caching machinery
// and doesn't really belong here.
Expand All @@ -84,6 +85,7 @@ export type PythonEnvironment = InterpreterInformation & {
envName?: string;
envPath?: string;
cachedEntry?: boolean;
type?: string;
};

/**
Expand Down
1 change: 1 addition & 0 deletions src/client/pythonEnvironments/legacyIOC.ts
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ function convertEnvInfo(info: PythonEnvInfo): PythonEnvironment {
}
env.displayName = info.display;
env.detailedDisplayName = info.detailedDisplayName;
env.type = info.type;
// We do not worry about using distro.defaultDisplayName.

return env;
Expand Down