Skip to content

Commit e093f27

Browse files
authored
[codex] fix unit test setup (#143)
## Summary - keep Cython overload declarations out of the compiled runtime source - ignore external Git diff drivers when checking staged changes before commits ## Why The dependency install and unit test setup initially hit two local-environment-sensitive blockers: Cython import initialization failed on runtime overload stubs, and a global external diff driver failed on intentionally binary/non-UTF-8 test fixtures. ## Validation - uv sync --dev --reinstall-package graph-sitter - uv run pytest tests/unit -n auto Final unit result: 2116 passed, 58 skipped, 12 xfailed.
1 parent 3878ed1 commit e093f27

2 files changed

Lines changed: 2 additions & 18 deletions

File tree

src/graph_sitter/compiled/autocommit.pyx

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import functools
22
from collections.abc import Callable
3-
from typing import Any, ParamSpec, TypeVar, Union, overload
3+
from typing import Any, ParamSpec, TypeVar, Union
44

55
import wrapt
66

@@ -20,14 +20,6 @@ def is_outdated(c) -> bool:
2020
return False
2121

2222

23-
@overload
24-
def reader(wrapped: Callable[P, T]) -> Callable[P, T]: ...
25-
26-
27-
@overload
28-
def reader(wrapped: None = None, *, cache: bool | None = ...) -> Callable[[Callable[P, T]], Callable[P, T]]: ...
29-
30-
3123
def reader(wrapped: Callable[P, T] | None = None, *, cache: bool | None = None) -> Callable[P, T] | Callable[[Callable[P, T]], Callable[P, T]]:
3224
"""Indicates this method is a read
3325

@@ -176,14 +168,6 @@ def update_dict(seen: set["Editable"], obj: "Editable", new_obj: "Editable"):
176168
assert not obj.is_outdated
177169
178170
179-
@overload
180-
def commiter(wrapped: Callable[P, T]) -> Callable[P, T]: ...
181-
182-
183-
@overload
184-
def commiter(wrapped: None = None, *, reset: bool = ...) -> Callable[[Callable[P, T]], Callable[P, T]]: ...
185-
186-
187171
def commiter(wrapped: Callable[P, T] | None = None, *, reset: bool = False) -> Callable[P, T] | Callable[[Callable[P, T]], Callable[P, T]]:
188172
"""Indicates this method is part of a commit. There should be no writes within this method and reads will not be updated
189173

src/graph_sitter/git/repo_operator/repo_operator.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -488,7 +488,7 @@ def _get_username_email(self) -> tuple[str, str] | None:
488488

489489
def commit_changes(self, message: str, verify: bool = False) -> bool:
490490
"""Returns True if a commit was made and False otherwise."""
491-
staged_changes = self.git_cli.git.diff("--staged")
491+
staged_changes = self.git_cli.git.diff("--no-ext-diff", "--staged")
492492
if staged_changes:
493493
if self.bot_commit and (info := self._get_username_email()):
494494
user, email = info

0 commit comments

Comments
 (0)