Skip to content

Commit 83b84e6

Browse files
fix(tests): use pip instead of uv for dummy plugin teardown uninstall
uv pip uninstall exits with code 2 for editable installs whose dist-info was not created by uv, even when the package is present. pip handles these reliably regardless of how the package was installed. [skip:test:long-running]
1 parent dc18a17 commit 83b84e6

1 file changed

Lines changed: 8 additions & 6 deletions

File tree

tests/aignostics/utils/conftest.py

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,12 +35,14 @@ def install_dummy_plugin() -> Iterator[None]:
3535
a reason other than the package already being absent.
3636
"""
3737
uv = shutil.which("uv")
38-
if uv:
39-
install_cmd = [uv, "pip", "install", "--no-deps", "-e", str(DUMMY_PLUGIN_DIR)]
40-
uninstall_cmd = [uv, "pip", "uninstall", "-y", "mcp-dummy-plugin"]
41-
else:
42-
install_cmd = [sys.executable, "-m", "pip", "install", "--no-deps", "-e", str(DUMMY_PLUGIN_DIR)]
43-
uninstall_cmd = [sys.executable, "-m", "pip", "uninstall", "-y", "mcp-dummy-plugin"]
38+
install_cmd = (
39+
[uv, "pip", "install", "--no-deps", "-e", str(DUMMY_PLUGIN_DIR)]
40+
if uv
41+
else [sys.executable, "-m", "pip", "install", "--no-deps", "-e", str(DUMMY_PLUGIN_DIR)]
42+
)
43+
# Always use pip for uninstall: uv pip uninstall can fail with exit code 2
44+
# for editable installs it did not itself create the dist-info for.
45+
uninstall_cmd = [sys.executable, "-m", "pip", "uninstall", "-y", "mcp-dummy-plugin"]
4446

4547
subprocess.run(install_cmd, check=True, capture_output=True, text=True)
4648

0 commit comments

Comments
 (0)