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 API to consume new Python API (but no used) #8324

Merged
merged 2 commits into from
Nov 22, 2021
Merged

Conversation

DonJayamanne
Copy link
Contributor

Part of #7849

@DonJayamanne DonJayamanne requested a review from a team as a code owner November 22, 2021 16:54
* Returns the conda executable.
*/
getCondaFile?(): Promise<string | undefined>;
getEnvironmentActivationShellCommands?(
Copy link
Contributor Author

Choose a reason for hiding this comment

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

New API exposed by python extension. Possible users don't have the latest python extenison hence we need to take that into account.

const CACHEKEY_FOR_CONDA_INFO = 'CONDA_INFORMATION_CACHE';

@injectable()
export class CondaService {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Exposes the CondaVersion, CondaFile behind a class with caching & wraps the Python API call (possible its not available, etc)

* then we can assume the version is the same.
* Even if not, we'll update this with the latest information.
*/
private async getCachedInformation(): Promise<{ version: SemVer; file: string } | undefined> {
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Comments added how & why we cache

@DonJayamanne DonJayamanne merged commit 402f1fa into main Nov 22, 2021
@DonJayamanne DonJayamanne deleted the condaRunApi branch November 22, 2021 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant