mirror of
https://github.com/pytorch/pytorch.git
synced 2025-10-20 21:14:14 +08:00
Update ruff linter for PEP585 (#147540)
This turns on PEP585 enforcement in RUFF. - Updates the target python version - Stops ignoring UP006 warnings (PEP585) - Fixes a few issues which crept into the tree in the last day Pull Request resolved: https://github.com/pytorch/pytorch/pull/147540 Approved by: https://github.com/justinchuby, https://github.com/Skylion007
This commit is contained in:
committed by
PyTorch MergeBot
parent
77d2780657
commit
086d146f6f
@ -255,9 +255,11 @@ class TestForeach(TestCase):
|
||||
else inputs
|
||||
)
|
||||
try:
|
||||
with InplaceForeachVersionBumpCheck(
|
||||
self, inputs[0]
|
||||
) if op.is_inplace else nullcontext():
|
||||
with (
|
||||
InplaceForeachVersionBumpCheck(self, inputs[0])
|
||||
if op.is_inplace
|
||||
else nullcontext()
|
||||
):
|
||||
actual = op(inputs, self.is_cuda, is_fastpath)
|
||||
except RuntimeError as e:
|
||||
with self.assertRaisesRegex(type(e), re.escape(str(e).splitlines()[0])):
|
||||
@ -278,9 +280,11 @@ class TestForeach(TestCase):
|
||||
try:
|
||||
op_kwargs = {}
|
||||
op_kwargs.update(kwargs)
|
||||
with InplaceForeachVersionBumpCheck(
|
||||
self, inputs[0]
|
||||
) if op.is_inplace else nullcontext():
|
||||
with (
|
||||
InplaceForeachVersionBumpCheck(self, inputs[0])
|
||||
if op.is_inplace
|
||||
else nullcontext()
|
||||
):
|
||||
actual = op(inputs, self.is_cuda, is_fastpath, **op_kwargs)
|
||||
except RuntimeError as e:
|
||||
with self.assertRaisesRegex(type(e), re.escape(str(e).splitlines()[0])):
|
||||
|
Reference in New Issue
Block a user