CI upgrade pyupgrade to v2.7.4
This should just be a matter of changing the version number to v2.7.4 for pyupgrade in .pre-commit-config.yaml, and checking that all still passes:
```
pre-commit run pyupgrade --all-files
```
If it does, please open a PR to upgrade - else, report on any failures