CI, STYLE sync flake8 versions
There's been a couple of recent CI failures due to differences in flake8 versions: #40481, #40457

CI failures due to style checks are really annoying, so I think it's worth adding a check to ensure they're in-sync. There's already a hook with `pyyaml` as additional dependency, so that environment will be reused for this check.
can you merge master and merge on green. thanks @MarcoGorelli 