ruff/scripts/ty_benchmark
Anh-Dung Nguyen e72f10be2d
[ty] Fix tool name is None when no ty path is given in ty_benchmark (#19870)
## Summary

When running the ty_benchmark, I found out that the Ty Tool name is None
when no ty_path is given as str(None)='None'
<img width="1011" height="168" alt="image"
src="https://github.com/user-attachments/assets/cf3e6d98-2329-48e9-b180-c72e4f01ccb6"
/>

## Test Plan
Minor fix, tested local
<img width="1105" height="218" alt="image"
src="https://github.com/user-attachments/assets/173128c9-dcfa-49f1-a58d-1b39a6c6b53b"
/>
2025-08-11 21:26:30 +00:00
..
src/benchmark [ty] Fix tool name is None when no ty path is given in ty_benchmark (#19870) 2025-08-11 21:26:30 +00:00
README.md Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
pyproject.toml Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00
uv.lock Rename Red Knot (#17820) 2025-05-03 19:49:15 +02:00

README.md

Getting started

  1. Install uv
  • Unix: curl -LsSf https://astral.sh/uv/install.sh | sh
  • Windows: powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
  1. Build ty: cargo build --bin ty --release
  2. cd into the benchmark directory: cd scripts/ty_benchmark
  3. Run benchmarks: uv run benchmark

Known limitations

ty only implements a tiny fraction of Mypy's and Pyright's functionality, so the benchmarks aren't in any way a fair comparison today. However, they'll become more meaningful as we build out more type checking features in ty.

Windows support

The script should work on Windows, but we haven't tested it yet. We do make use of shlex which has known limitations when using non-POSIX shells.