[BE]: Update ruff to 0.6.0 (#133609)

Updates ruff and fixes a couple false negatives it discovered.
Pull Request resolved: https://github.com/pytorch/pytorch/pull/133609
Approved by: https://github.com/malfet
This commit is contained in:
Aaron Gokaslan
2024-08-16 14:11:01 +00:00
committed by PyTorch MergeBot
parent eca8b4220f
commit 51e13745be
3 changed files with 5 additions and 4 deletions

View File

@ -1479,7 +1479,7 @@ init_command = [
'black==23.12.1',
'usort==1.0.8.post1',
'isort==5.13.2',
'ruff==0.5.5', # sync with RUFF
'ruff==0.6.0', # sync with RUFF
]
is_formatter = true
@ -1564,7 +1564,7 @@ init_command = [
'python3',
'tools/linter/adapters/pip_init.py',
'--dry-run={{DRYRUN}}',
'ruff==0.5.5', # sync with PYFMT
'ruff==0.6.0', # sync with PYFMT
]
is_formatter = true

View File

@ -18,7 +18,7 @@ def _get_ops_list(m: torch.fx.GraphModule):
class TestQuantizePT2EModels(TestCase):
@pytest.mark.xfail()
@pytest.mark.xfail
@skip_if_no_torchvision
def test_vit_aten_export(self):
from torchvision.models import vit_b_16 # @manual

View File

@ -295,7 +295,8 @@ class ScriptMeta(type):
# We leave built-in ScriptModule types alone, since this metaclass
# is only for compiling user classes that inherit from
# ScriptModule.
return super().__init__(name, bases, attrs)
super().__init__(name, bases, attrs)
return
original_init = getattr(cls, "__init__", lambda self: None)