mirror of
https://github.com/saymrwulf/pytorch.git
synced 2026-05-14 20:57:59 +00:00
Enables B027 and applies fixes by adding abstract method decorators. Autofix generated by ruff master. Pull Request resolved: https://github.com/pytorch/pytorch/pull/100715 Approved by: https://github.com/ezyang
78 lines
1.8 KiB
TOML
78 lines
1.8 KiB
TOML
[build-system]
|
|
requires = [
|
|
"setuptools",
|
|
"wheel",
|
|
"astunparse",
|
|
"numpy",
|
|
"ninja",
|
|
"pyyaml",
|
|
"setuptools",
|
|
"cmake",
|
|
"typing-extensions",
|
|
"requests",
|
|
]
|
|
# Use legacy backend to import local packages in setup.py
|
|
build-backend = "setuptools.build_meta:__legacy__"
|
|
|
|
|
|
[tool.black]
|
|
# Uncomment if pyproject.toml worked fine to ensure consistency with flake8
|
|
# line-length = 120
|
|
target-version = ["py38", "py39", "py310", "py311"]
|
|
|
|
|
|
[tool.ruff]
|
|
target-version = "py38"
|
|
|
|
# NOTE: Synchoronize the ignores with .flake8
|
|
ignore = [
|
|
# these ignores are from flake8-bugbear; please fix!
|
|
"B007", "B008", "B017",
|
|
"B018", # Useless expression
|
|
"B019", "B020",
|
|
"B023", "B024", "B026",
|
|
"B028", # No explicit `stacklevel` keyword argument found
|
|
"B904", "B905",
|
|
"E402",
|
|
"C408", # C408 ignored because we like the dict keyword argument syntax
|
|
"E501", # E501 is not flexible enough, we're using B950 instead
|
|
"E721",
|
|
"E731", # Assign lambda expression
|
|
"E741",
|
|
"EXE001",
|
|
"F405",
|
|
"F821",
|
|
"F841",
|
|
# these ignores are from flake8-logging-format; please fix!
|
|
"G101", "G201", "G202",
|
|
"SIM102", "SIM103", "SIM112", # flake8-simplify code styles
|
|
"SIM105", # these ignores are from flake8-simplify. please fix or ignore with commented reason
|
|
"SIM108",
|
|
"SIM110",
|
|
"SIM114", # Combine `if` branches using logical `or` operator
|
|
"SIM115",
|
|
"SIM116", # Disable Use a dictionary instead of consecutive `if` statements
|
|
"SIM117",
|
|
"SIM118",
|
|
]
|
|
line-length = 120
|
|
select = [
|
|
"B",
|
|
"C4",
|
|
"G",
|
|
"E",
|
|
"F",
|
|
"SIM1",
|
|
"W",
|
|
]
|
|
|
|
[tool.ruff.per-file-ignores]
|
|
"__init__.py" = ["F401"]
|
|
"torchgen/api/types/__init__.py" = [
|
|
"F401",
|
|
"F403",
|
|
]
|
|
"torchgen/executorch/api/types/__init__.py" = [
|
|
"F401",
|
|
"F403",
|
|
]
|