Skip to content

Commit 93ba097

Browse files
authored
Merge branch 'main' into don/diplomatic-mink
2 parents 596245b + 9fd7b9b commit 93ba097

File tree

5 files changed

+17
-5
lines changed

5 files changed

+17
-5
lines changed

.vscodeignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
**/*.map
22
**/*.analyzer.html
3+
**/.env
34
*.vsix
45
.editorconfig
56
.env

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1534,7 +1534,7 @@
15341534
"when": "false"
15351535
},
15361536
{
1537-
"name": "python_install_package",
1537+
"name": "install_python_package",
15381538
"displayName": "Install Python Package",
15391539
"userDescription": "%python.languageModelTools.python_install_package.userDescription%",
15401540
"modelDescription": "Installs Python packages in the given workspace. Use this tool to install packages in the user's chosen environment.",

python_files/unittestadapter/execution.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@
1212
from types import TracebackType
1313
from typing import Dict, List, Optional, Set, Tuple, Type, Union
1414

15-
from packaging.version import Version
16-
1715
# Adds the scripts directory to the PATH as a workaround for enabling shell for test execution.
1816
path_var_name = "PATH" if "PATH" in os.environ else "Path"
1917
os.environ[path_var_name] = (
@@ -326,6 +324,13 @@ def send_run_data(raw_data, test_run_pipe):
326324
)
327325
import coverage
328326

327+
# insert "python_files/lib/python" into the path so packaging can be imported
328+
python_files_dir = pathlib.Path(__file__).parent.parent
329+
bundled_dir = pathlib.Path(python_files_dir / "lib" / "python")
330+
sys.path.append(os.fspath(bundled_dir))
331+
332+
from packaging.version import Version
333+
329334
coverage_version = Version(coverage.__version__)
330335
# only include branches if coverage version is 7.7.0 or greater (as this was when the api saves)
331336
if coverage_version >= Version("7.7.0"):

python_files/vscode_pytest/__init__.py

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
from typing import TYPE_CHECKING, Any, Dict, Generator, Literal, TypedDict
1414

1515
import pytest
16-
from packaging.version import Version
1716

1817
if TYPE_CHECKING:
1918
from pluggy import Result
@@ -443,6 +442,13 @@ def pytest_sessionfinish(session, exitstatus):
443442
# load the report and build the json result to return
444443
import coverage
445444

445+
# insert "python_files/lib/python" into the path so packaging can be imported
446+
python_files_dir = pathlib.Path(__file__).parent.parent
447+
bundled_dir = pathlib.Path(python_files_dir / "lib" / "python")
448+
sys.path.append(os.fspath(bundled_dir))
449+
450+
from packaging.version import Version
451+
446452
coverage_version = Version(coverage.__version__)
447453
global INCLUDE_BRANCHES
448454
# only include branches if coverage version is 7.7.0 or greater (as this was when the api saves)

src/client/chat/installPackagesTool.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export interface IInstallPackageArgs {
2626
}
2727

2828
export class InstallPackagesTool implements LanguageModelTool<IInstallPackageArgs> {
29-
public static readonly toolName = 'python_install_package';
29+
public static readonly toolName = 'install_python_package';
3030
constructor(
3131
private readonly api: PythonExtension['environments'],
3232
private readonly serviceContainer: IServiceContainer,

0 commit comments

Comments
 (0)