Umbrella: consolidate onto a uv + ruff + pyrefly toolchain
- Dominant language
- Python
- Stars
- 743
- Forks
- 150
- Avg merge
- 6d 1h
- Merged PRs (30d)
- 2
Description
### Goal
Move Pynite dev tooling to a cohesive, fast, mostly-Rust toolchain.
Here is what I'm proposing to add:
- uv (packaging)
- ruff (lint/format)
- pyrefly or ty (type checking)
- possibly add ruff format so formatting on files becomes consistent across the whole project
This would replace the current flake8 + ruff overlap, ad-hoc pip installs, and absence of type checking in CI/development outside of editor type checking.
Here are some of the existing PRs or issues that are related:
- #299 — ruff F401 + pre-commit + lint workflow (first step, intentionally minimal)
- #300 — adds UP (pyupgrade) ruleset; depends on #299, supersedes #297
- #297 (closed) — standalone pyupgrade, replaced by ruff approach
- #298 (closed) — ruff format trial: large diff due to "scientific"/matrix styling — formatting deferred/contentious
- #252 (merged) — type hints already present throughout
### Proposed workstreams (need maintainers buy-in)
1. Packaging → uv + pyproject.toml. Migrate setup.py to pyproject.toml; map extras_require to dependency groups; add uv.lock; swap the CI pip block for setup-uv + uv sync.
2. Linting → finish ruff rollout. Continue stacked PRs after #300 (E, W, I), migrate .flake8 ignores into ruff.toml, then retire flake8 (delete .flake8, drop the flake8 step in build-and-test.yml).
3. Type checking → pyrefly. Stable v1.0 (May 2026); proven on PyTorch/JAX (numerics-heavy, like us). Start lenient, tighten over time. Wire into CI (`uv run pyrefly check`) and pre-commit.
- Alternatives considered: ty (Astral; pairs with ruff/uv but still beta — revisit at its 1.0); mypy (mature fallback). pyright not pursued due to Node JS requirement.
5. CI runner. With uv, run tools via `uv run … --output-format=github` for inline annotations (resolves the prek-vs-native tradeoff from #299); keep .pre-commit-config.yaml for local hooks.
### Open decisions
- Formatting: adopt ruff format despite the #298 diff (reconciling the .flake8 E226/E201/E241 matrix-spacing ignores), or skip indefinitely?
- Type-checker confirmation: pyrefly now / ty-when-stable / mypy — agree?
Contributor guide
Assessment
This issue has not been assessed yet.