mirror of
https://github.com/zebrajr/pytorch.git
synced 2025-12-06 00:20:18 +01:00
Looking for feedback on this approach. Received user reports of spurious pyrefly errors for users using hg instead of git. I think this was due to the fact that when using a venv and git, `make setup-env` installs requirements and pulls from a nightly torch wheel, which is needed for pyrefly to type check properly. Initial documentation for `make setup-env` I found here: https://github.com/pytorch/pytorch/blob/main/CONTRIBUTING.md#developing-pytorch Testing: ``` hg clone --git ssh://git@github.com/pytorch/pytorch.git conda create -n pytorch_env python=3.10 # (or manually create venv instead of using script) cd pytorch pip install -r requirements.txt pip install -r requirements-build.txt lintrunner init # check how many pyrefly errors - 15,709 errors (11,693 ignored) lintrunner # confirm error message / warning appears >>> General linter failure: Warning (PYREFLY) nightly-wheel-not-run pytorch-nightly.pth not found. You may need to run make setup-env or make setup-env-conda to install nightly binaries and type stubs. ``` Pull Request resolved: https://github.com/pytorch/pytorch/pull/166603 Approved by: https://github.com/aorenste |
||
|---|---|---|
| .. | ||
| _linter | ||
| actionlint_linter.py | ||
| bazel_linter.py | ||
| clangformat_linter.py | ||
| clangtidy_linter.py | ||
| cmake_linter.py | ||
| cmake_minimum_required_linter.py | ||
| codespell_linter.py | ||
| docstring_linter-grandfather.json | ||
| docstring_linter.py | ||
| exec_linter.py | ||
| flake8_linter.py | ||
| gb_registry_linter.py | ||
| gha_linter.py | ||
| grep_linter.py | ||
| header_only_linter.py | ||
| import_linter.py | ||
| lintrunner_version_linter.py | ||
| mypy_linter.py | ||
| nativefunctions_linter.py | ||
| newlines_linter.py | ||
| no_merge_conflict_csv_linter.py | ||
| no_workflows_on_fork.py | ||
| pip_init.py | ||
| pyfmt_linter.py | ||
| pyproject_linter.py | ||
| pyrefly_linter.py | ||
| README.md | ||
| ruff_linter.py | ||
| s3_init_config.json | ||
| s3_init.py | ||
| set_linter.py | ||
| shellcheck_linter.py | ||
| test_device_bias_linter.py | ||
| test_has_main_linter.py | ||
| testowners_linter.py | ||
| update_s3.py | ||
| workflow_consistency_linter.py | ||
lintrunner adapters
These files adapt our various linters to work with lintrunner.
Adding a new linter
- init and linter
- {{DRYRUN}} and {{PATHSFILE}}
- never exit uncleanly
- Communication protocol
- Self-contained