pytorch
e85dfb62 - Add pyproject.toml for black configuration (#79399)

Commit
2 years ago
Add pyproject.toml for black configuration (#79399) Motivation - Ensure black configuration consistency with other tools (flake8, isort) Currently linter and formatter tools (flake8, isort and black) configuration about line length are inconsistent. flake8 is 120, isort is 79 (default), black is 88 (default). https://github.com/pytorch/pytorch/blob/ba27ee9e8fc57f7509d2bf0c0be73510802806c0/.flake8#L3 isort.cfg does not specify line length. https://github.com/pytorch/pytorch/blob/ba27ee9e8fc57f7509d2bf0c0be73510802806c0/.isort.cfg#L1-L6 black supports only `pyproject.toml` as a configuration file. However `pyproject.toml` was previously removed #61367 since it had some build issues. I also resolved them by - Use `setuptools.build_meta:__legacy__` as a build-backend to import local packages (e.g. tools) in setup.py (related https://github.com/pytorch/pytorch/pull/60408#issuecomment-873979383) - Add build time dependencies to requires for PEP 517 isolation build environment. This PR does not change line length of black and isort since they will cause a lot of file changes. We should apply in the future if `pyproject.toml` worked fine. Pull Request resolved: https://github.com/pytorch/pytorch/pull/79399 Approved by: https://github.com/suo
Author
Committer
Parents
Loading