Skip to content

Commit aa1fad6

Browse files
authored
Support relative --ty-path in ty-benchmark (astral-sh#18385)
## Summary This currently doesn't work because the benchmark changes the working directory. Also updates the process name to make it easier to compare two local ty binaries.
1 parent b390b3c commit aa1fad6

File tree

1 file changed

+4
-4
lines changed
  • scripts/ty_benchmark/src/benchmark

1 file changed

+4
-4
lines changed

scripts/ty_benchmark/src/benchmark/cases.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,9 @@ class Ty(Tool):
5959

6060
def __init__(self, *, path: Path | None = None):
6161
self.name = str(path) or "ty"
62-
self.path = path or (
63-
(Path(__file__) / "../../../../../target/release/ty").resolve()
64-
)
62+
self.path = (
63+
path or (Path(__file__) / "../../../../../target/release/ty")
64+
).resolve()
6565

6666
assert self.path.is_file(), (
6767
f"ty not found at '{self.path}'. Run `cargo build --release --bin ty`."
@@ -73,7 +73,7 @@ def cold_command(self, project: Project, venv: Venv) -> Command:
7373
command.extend(["--python", str(venv.path)])
7474

7575
return Command(
76-
name="ty",
76+
name=self.name,
7777
command=command,
7878
)
7979

0 commit comments

Comments
 (0)