Before running ANY Python command, terminal command, or pip install:
source .venv/bin/activateThen verify with: which python (should show .venv/bin/python)
| Task | Command (after activating venv) |
|---|---|
| Run tests | python -m pytest tests/ -v |
| Type check | pyrefly check |
| Install deps | pip install -r requirements.txt |
| Run main | python main.py <num_packages> |
| Run LSP benchmark | python -m lsp.benchmark.daily_runner --packages 5 --runs 3 |
| Run benchmark on local dir | python -m typecheck_benchmark --local /path/to/project |
This project analyzes Python type coverage across popular PyPI packages and benchmarks LSP performance.
- Virtual environment: ALWAYS
source .venv/bin/activatefirst - Type checker: Use
pyrefly check(not pyright/mypy for linting) - Typeshed: Don't modify files in
typeshed/- it's a git submodule - Type annotations: Required on all functions
- Python version: 3.12
- Git workflow: NEVER commit or push directly to main. Always create a feature branch, push it to origin, and let the user merge.
Before every commit, run ALL of these checks:
source .venv/bin/activate
python -m pytest tests/ -v # Python tests
pyrefly check # Python type checking
npm run check # TypeScript type checking (runs tsc --noEmit)Type check all modified Python files, including files in tests/, lsp/, and typecheck_benchmark/.
Both the LSP benchmark and typecheck benchmark use typecheck_benchmark/install_envs.json as their single source of truth for packages. They must always test the same set of packages.