Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Port Python Env Tools#25066

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
DonJayamanne merged 4 commits intomainfromdon/teenage-stork
May 14, 2025
Merged

Port Python Env Tools#25066

DonJayamanne merged 4 commits intomainfromdon/teenage-stork
May 14, 2025

Conversation

DonJayamanne
Copy link

@DonJayamanneDonJayamanne commentedMay 14, 2025
edited
Loading

  • Tested with .venv, global conda, local conda and global Python
  • Tested both tools

Screenshot 2025-05-14 at 11 54 44
Screenshot 2025-05-14 at 11 57 39
Screenshot 2025-05-14 at 11 57 49

@DonJayamanneDonJayamanne added no-changelogNo news entry required skip package*.jsonpackage.json and package-lock.json don't both need updating skip testsUpdates to tests unnecessary skip-issue-check labelsMay 14, 2025
"resourcePath"
]
},
"when": "!pythonEnvExtensionInstalled"
Copy link
Author

Choose a reason for hiding this comment

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

Will ensure these tools are disabled when Python Env extension is installed

@@ -162,6 +163,7 @@ async function activateUnsafe(
components.pythonEnvs,
);
const proposedApi = buildProposedApi(components.pythonEnvs, ext.legacyIOC.serviceContainer);
registerTools(context,components.pythonEnvs, api.environments, ext.legacyIOC.serviceContainer);
Copy link
Author

Choose a reason for hiding this comment

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

Given these tools are temporary until Env extension goes stable, I didn't want to spend too much effort into moving these into the component registration, that was a lot of work, same with using Python API to get env details (there are too many ways to get env details, else resorted to using the external API as thats the stable way).

env: CondaEnvInfo,
forShellExecution?: boolean,
): Promise<string[] | undefined> {
const args = ['-p', env.prefix];
Copy link
Author

Choose a reason for hiding this comment

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

Using-p as thats exactly whats done today ingetRunPythonArgs,
See the method right above this.

// Copyright (c) Microsoft Corporation. All rights reserved.
// Licensed under the MIT License.

export interface PipPackage {
Copy link
Author

Choose a reason for hiding this comment

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

Copied from Python Env repo

* Returns a promise that rejects with an {@CancellationError} as soon as the passed token is cancelled.
* @see {@link raceCancellation}
*/
export function raceCancellationError<T>(promise: Promise<T>, token: CancellationToken): Promise<T> {
Copy link
Author

Choose a reason for hiding this comment

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

Couldn't move intoasync.ts as that doesn't allow usage ofvscode types for some reason.
Left here for private use, again these will go away when env extension is stable.

ourTools.add(
extensions.onDidChange(() => {
const envExtension = extensions.getExtension(ENVS_EXTENSION_ID);
if (envExtension) {
Copy link
Author

Choose a reason for hiding this comment

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

Check if env extension is installed and disable this.

_token: CancellationToken,
): Promise<PreparedToolInvocation> {
return {
invocationMessage: l10n.t('Fetching Python environment information'),
Copy link
Author

Choose a reason for hiding this comment

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

I will port these changes toprepareInvocation into the Python env extension soon

: l10n.t(`Installing packages {0} in {1}`, options.input.packageList.sort().join(', '), envName);
} else {
title =
options.input.packageList.length === 1
Copy link
Author

Choose a reason for hiding this comment

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

I will port these changes toprepareInvocation into the Python env extension soon

@DonJayamanneDonJayamanne marked this pull request as ready for reviewMay 14, 2025 20:13
@vs-code-engineeringvs-code-engineeringbot added this to theMay 2025 milestoneMay 14, 2025
@DonJayamanneDonJayamanne merged commit4367614 intomainMay 14, 2025
85 checks passed
@DonJayamanneDonJayamanne deleted the don/teenage-stork branchMay 14, 2025 21:11
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@karthiknadigkarthiknadigkarthiknadig approved these changes

@eleanorjboydeleanorjboydAwaiting requested review from eleanorjboyd

Assignees

@DonJayamanneDonJayamanne

Labels
no-changelogNo news entry requiredskip package*.jsonpackage.json and package-lock.json don't both need updatingskip testsUpdates to tests unnecessaryskip-issue-check
Projects
None yet
Milestone
May 2025
Development

Successfully merging this pull request may close these issues.

2 participants
@DonJayamanne@karthiknadig

[8]ページ先頭

©2009-2025 Movatter.jp