Skip to content

Commit 21a8be7

Browse files
committed
chore(uv): fix calls that were not correctly migrated from Poetry to uv
1 parent 712bfb7 commit 21a8be7

6 files changed

Lines changed: 11 additions & 11 deletions

File tree

src/python_claude/hooks/mypy_hook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ def run(self) -> int:
5353

5454
# mypy writes errors to stdout, but only stderr is fed back to Claude
5555
result = subprocess.run(
56-
["poetry", "run", "mypy", mypy_target],
56+
["uv", "run", "mypy", mypy_target],
5757
cwd=self.project_dir,
5858
stdout=sys.stderr, # Redirect stdout to stderr for Claude
5959
)

src/python_claude/hooks/pytest_hook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def run(self) -> int:
3939
self.log("Running pytest")
4040

4141
result = subprocess.run(
42-
["poetry", "run", "pytest"],
42+
["uv", "run", "pytest"],
4343
cwd=self.project_dir,
4444
stdout=sys.stderr,
4545
)

src/python_claude/hooks/ruff_check_hook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def run(self) -> int:
4747
self.log(f"Checking {len(files)} files: {' '.join(files)}")
4848

4949
result = subprocess.run(
50-
["poetry", "run", "ruff", "check", "--fix", *files],
50+
["uv", "run", "ruff", "check", "--fix", *files],
5151
cwd=self.project_dir,
5252
stdout=sys.stderr,
5353
)

src/python_claude/hooks/ruff_format_hook.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ def run(self) -> int:
4747
self.log(f"Formatting {len(files)} files: {' '.join(files)}")
4848

4949
result = subprocess.run(
50-
["poetry", "run", "ruff", "format", *files],
50+
["uv", "run", "ruff", "format", *files],
5151
cwd=self.project_dir,
5252
stdout=sys.stderr,
5353
)

src/python_claude/hooks/session_start_hook.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,10 +47,10 @@ def run(self) -> int:
4747
f"{checks_list} after you edit a file. You don't need "
4848
f"to run these commands manually. You can run these before making "
4949
f"an edit using:\n"
50-
f"- poetry run ruff format .\n"
51-
f"- poetry run ruff check .\n"
52-
f"- poetry run mypy .\n"
53-
f"- poetry run pytest"
50+
f"- uv run ruff format .\n"
51+
f"- uv run ruff check .\n"
52+
f"- uv run mypy .\n"
53+
f"- uv run pytest"
5454
)
5555
else:
5656
additional_context = (

tests/test_mypy_hook.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def test_python_file_success(self, tmp_path: Path) -> None:
2727
mock_run.assert_called_once()
2828
# Verify it ran mypy on the specific file
2929
call_args = mock_run.call_args
30-
assert call_args[0][0] == ["poetry", "run", "mypy", "/path/to/file.py"]
30+
assert call_args[0][0] == ["uv", "run", "mypy", "/path/to/file.py"]
3131

3232
def test_python_file_type_errors(self, tmp_path: Path) -> None:
3333
"""Test mypy type errors (exit 1) are transformed to exit code 2."""
@@ -99,7 +99,7 @@ def test_stop_hook_no_file_path_success(self, tmp_path: Path) -> None:
9999
mock_run.assert_called_once()
100100
# Verify it ran mypy on current directory
101101
call_args = mock_run.call_args
102-
assert call_args[0][0] == ["poetry", "run", "mypy", "."]
102+
assert call_args[0][0] == ["uv", "run", "mypy", "."]
103103
# Verify tracking file was cleaned up on success
104104
assert not hook.track_file.exists()
105105

@@ -166,7 +166,7 @@ def test_empty_file_path_runs_full_check(self, tmp_path: Path) -> None:
166166
assert exit_code == 0
167167
# Verify it ran mypy on current directory
168168
call_args = mock_run.call_args
169-
assert call_args[0][0] == ["poetry", "run", "mypy", "."]
169+
assert call_args[0][0] == ["uv", "run", "mypy", "."]
170170

171171
def test_mypy_skipped_when_disabled(self, tmp_path: Path) -> None:
172172
"""Test that mypy is skipped when disabled in state."""

0 commit comments

Comments
 (0)