-
Notifications
You must be signed in to change notification settings - Fork 29
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 --user
flag to global dvc auto installation
#4091
Changes from 6 commits
72fbb87
76706bf
90aacab
8462a34
126c2a5
a3d5a4e
c1147a7
08d7ffe
a0d1b14
f0648dc
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -11,15 +11,24 @@ interface Settings { | |
} | ||
} | ||
|
||
type EnvironmentVariables = { readonly [key: string]: string | undefined } | ||
type EnvironmentVariables = { readonly [key: string]: undefined } | ||
type EnvironmentVariablesChangeEvent = { | ||
readonly env: EnvironmentVariables | ||
} | ||
|
||
interface Environment { | ||
id: string | ||
environment?: { | ||
type: string | ||
} | ||
} | ||
|
||
export interface VscodePython { | ||
ready: Thenable<void> | ||
settings: Settings | ||
environments: { | ||
known: Environment[] | ||
getActiveEnvironmentPath: () => { id: string } | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. [I] If we are using this we also need to use [Q] Can we replace our other use of the API with this now? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Updates are triggered with
Apologies, I'm not sure what you mean. What other use of the API could be replaced? Looking at the API, they all seem to be doing different things to me 🤔 There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Going to merge this, but happy to update the use of the API in a followup! There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We use
☝🏻 maybe we can't rely on this as it could return a folder and not an executable. Nevermind. |
||
onDidEnvironmentVariablesChange: Event<EnvironmentVariablesChangeEvent> | ||
getEnvironmentVariables(): EnvironmentVariables | ||
} | ||
|
@@ -56,6 +65,18 @@ export const getPYTHONPATH = async (): Promise<string | undefined> => { | |
return api?.environments?.getEnvironmentVariables().PYTHONPATH | ||
} | ||
|
||
export const isActivePythonEnvGlobal = async (): Promise< | ||
boolean | undefined | ||
> => { | ||
const api = await getPythonExtensionAPI() | ||
if (!api?.environments) { | ||
return | ||
} | ||
const envPath = api.environments.getActiveEnvironmentPath() | ||
const activeEnv = api.environments.known.find(({ id }) => id === envPath.id) | ||
return activeEnv && !activeEnv.environment | ||
} | ||
|
||
export const getOnDidChangePythonExecutionDetails = async () => { | ||
const api = await getPythonExtensionAPI() | ||
return api?.settings?.onDidChangeExecutionDetails | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[Q] is this change intentional?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nope! I think it happened when I was fixing a merge conflict.