Repository navigation
pants-pyrefly 0.1.0
Initial release.
- Run Pyrefly (default
1.1.1) as a Python type checker in the Pantscheckgoal. - Download the official prebuilt Pyrefly binary per platform (macOS arm64/x86_64, Linux arm64/x86_64 musl), pinned by SHA256.
- First-party import resolution via
--search-path, third-party resolution via a materialized requirements venv (--python-interpreter-path). [pyrefly]subsystem options (skip,args,output_format,extra_type_stubs,config,config_discovery,version, …) and a per-targetskip_pyreflyfield.extra_type_stubsinjects stub-only packages into the environment Pyrefly inspects; an explicit[pyrefly].configpath is passed through to Pyrefly via--config.- The list of files to check is passed to Pyrefly via an argfile, so large targets never hit OS command-line length limits.
- Incremental adoption:
[pyrefly].baselinemakescheckreport only errors new since the baseline, and thepants pyrefly-update-baselinegoal records/refreshes that baseline file. pants pyrefly-lsp-configwrites Pants's source roots intopyrefly.tomlassearch-path, so the Pyrefly editor/LSP resolves first-party imports the way Pants does.- Triage controls
[pyrefly].min_severityand[pyrefly].only; andchecknow flags a Pyrefly tool failure (an exit code other than 0/1) distinctly from ordinary type errors. pants pyrefly-coveragereports overall type coverage (% of typable symbols typed), with an optional--pyrefly-coverage-fail-underthreshold to ratchet/gate it.- Supports Pants
2.27–2.32from a single codebase, via version-conditional imports for the rules-API change at 2.29 (coarsened_targets→resolve_coarsened_targets) and theCheckSubsystem.default_process_cache_scopeaddition at 2.32. Verified on 2.27 and 2.32. - The published wheel is pure-Python (
Requires-Python: >=3.12) and carries nopantsbuild.pantsdependency (Pants provides itself at runtime, and is no longer on PyPI). It installs into any Pants on CPython 3.12+ (Pants 2.27, on CPython 3.11, uses the from-source install). Verified end-to-end via aplugins=["… @ file://…whl"]install.