Update ruff linter for PEP585 (#147540)
Summary:
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
X-link: https://github.com/pytorch/pytorch/pull/147540
Approved by: https://github.com/justinchuby, https://github.com/Skylion007
Reviewed By: jeanschmidt
Differential Revision: D70039279
fbshipit-source-id: e609f738b97484a281ebe244db35fe02ab0a3590