GeezerVison is showing github.com — The pre-commit hooks do not work on macOS · Issue #110652 · python/cpython
The pre-commit hooks do not work on macOS #110652
Description
$ grep "entry.*python" .pre-commit-config.yaml
entry: 'python Tools/patchcheck/reindent.py --nobackup --newline LF'
entry: "python Tools/patchcheck/untabify.py"
Unfortunately, there is no python on macOS; only python3. Can we change these to python3?
Linked PRs
Activity
erlend-aasland commented on Oct 10, 2023
ContributorAuthor
More actions
Simply executing these scripts directly would also do:
$ head -n1 Tools/patchcheck/*.py
==> Tools/patchcheck/patchcheck.py <==
#!/usr/bin/env python3
==> Tools/patchcheck/reindent.py <==
#! /usr/bin/env python3
==> Tools/patchcheck/untabify.py <==
#! /usr/bin/env python3
hugovk commented on Oct 10, 2023
Yep, see also comments at #109891 (comment).
We can't use python3 because that won't work on Windows...
Let's check if direct execution works on Windows.
AlexWaygood commented on Oct 10, 2023
We can't use python3 because that won't work on Windows...
Let's check if direct execution works on Windows.
Unfortunately neither approach works on Windows: see #110653 (comment) ://
AlexWaygood commented on Oct 11, 2023
I think we should revert these commits until we figure out how to fix this properly (if it can be "fixed properly"):
Reacted by Hugo van Kemenade
hugovk commented on Oct 11, 2023
Agree to revert.
I'd prefer to replace Tools/patchcheck/reindent.py and Tools/patchcheck/untabify.py with other pre-commit hooks.
Reacted by Erlend E. Aasland
erlend-aasland commented on Oct 11, 2023
ContributorAuthor
More actions
I'd prefer to replace Tools/patchcheck/reindent.py and Tools/patchcheck/untabify.py with other pre-commit hooks.
Surely there must be existing hooks we can use.
If we need CPython specific hooks, we can create a repo for them under the GitHub python org. (for example python/pre-commit)
Reacted by Hugo van Kemenade and Thomas Grainger
Metadata
Metadata
Development
No branches or pull requestsIssue actions