For black, the pre-commit config overrides the language version to python3.12 specifically. Since I didn’t have 3.12 on my machine, I tested python3, and it worked fine
I wasn’t sure whether this should just be a gh issue, or a topic of discussion here, so I opted for the more conservative option.
Edited to remove incorrect information about PyO3. I’ll create a new thread for that discussion.
I wonder if we should move pre-commit setup instructions to some more advanced section of the devguide, so it doesn’t act as a roadblock to new contributors.
As far as I know, not that many core devs use pre-commit locally (I certainly don’t). If you’re not actively working on a part of the codebase that requires pre-commit, I think it’s OK to wait for the CI to tell you about the problems, like a human maintainer would.
Apparently, pre-commit instructions are not well tested in various environments. And they’re incomplete – they omit the part where you get the pre-commit command, plus a working copy of Python to get/run it (though needing a specific version looks like a a bug).
I’d be in favor of mandatory pre-commit in our workflows if we could make it easy and natural for devs to have correctly installed and functioning on all our tier platforms. (we’re obviously not there… yet)
We have checks that fail in CI that are embarrassing to ever see fail so long after pushing a PR because their fixes could’ve been entirely automated via pre-commit.