| FazBrowse GitHub Viewer | Trending | | Home |
| Tools: [Download Repo ZIP] [Original HTTPS Page] |
|
This approach doesn't work on Windows, unfortunately, I don't think. I think I'd prefer using a python-language hook, as @hugovk suggested in #109891 (comment) (but see @AA-Turner's comments in #109891 (comment)) |
Sorry, something went wrong.
There was a problem hiding this comment.
Does this work on Windows?
Sorry, something went wrong.
no: >pre-commit run --all-files Run Ruff on Lib/test/....................................................Passed Run Ruff on Argument Clinic..............................................Passed check toml...............................................................Passed check yaml...............................................................Passed fix end of files.........................................................Passed trim trailing whitespace.................................................Passed Check Python file whitespace.............................................Failed - hook id: python-file-whitespace - exit code: 9009 Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Check C file whitespace..................................................Failed - hook id: c-file-whitespace - exit code: 9009 Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Sphinx lint..............................................................Passed Check hooks apply to the repository......................................Passed Check for useless excludes...............................................Passed |
Sorry, something went wrong.
|
It isn't well documented, but I had hoped language: script offered the salvation we desire. Sadly; no: Check Python file whitespace.............................................Failed - hook id: python-file-whitespace - exit code: 1 Executable `python3` not found Check C file whitespace..................................................Failed - hook id: c-file-whitespace - exit code: 1 Executable `python3` not found This is, I think, as the shebang line says #! /usr/bin/env python3 -- if I change it to #! /usr/bin/env python, it passes for me. I'm not sure how to write such a line to choose between python3 or python, though. A |
Sorry, something went wrong.
|
With: name: "Check Python file whitespace"
entry: 'Tools/patchcheck/reindent.py --nobackup --newline LF'And: #! /usr/bin/env pythonOn macOS I get: Executable `python` not found |
Sorry, something went wrong.
|
@AA-Turner, in #109891 (comment) you commented that using a Python-language hook (rather than a system-language hook, as we have currently) might slow us down unnecessarily, as pre-commit would have to create a venv before the hook would run. But in my experience, the Python-language hooks in the pre-commit-hooks package are plenty fast enough. I think pre-commit might locally cache the venvs it creates, and reuse them in future invocations of the same hook? |
Sorry, something went wrong.
|
@AlexWaygood, does 9501fab work on Windows? |
Sorry, something went wrong.
Argh, that's still a no :(( Details>pre-commit run --all-files [INFO] Initializing environment for local. [INFO] Installing environment for local. [INFO] Once installed this environment will be reused. [INFO] This may take a few minutes... Run Ruff on Lib/test/....................................................Passed Run Ruff on Argument Clinic..............................................Passed check toml...............................................................Passed check yaml...............................................................Passed fix end of files.........................................................Passed trim trailing whitespace.................................................Passed Check Python file whitespace.............................................Failed - hook id: python-file-whitespace - exit code: 9009 Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Check C file whitespace..................................................Failed - hook id: c-file-whitespace - exit code: 9009 Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Python was not found; run without arguments to install from the Microsoft Store, or disable this shortcut from Settings > Manage App Execution Aliases. Sphinx lint..............................................................Passed Check hooks apply to the repository......................................Passed Check for useless excludes...............................................Passed |
Sorry, something went wrong.
|
Sounds like it's a pre-commit bug; their docs says it should work on Windows: https://pre-commit.com/#python |
Sorry, something went wrong.
The docs also say this, however, which isn't what we're doing:
I'm guessing this is the issue here -- the python-language hooks in the pre-commit-hooks repo are all installed hooks that have their own entry points: https://github.com/pre-commit/pre-commit-hooks/blob/27dcd3fd1dc01d3fdbeb188edb54dddf3d964236/setup.cfg#L31 |
Sorry, something went wrong.
|
Then let's make those scripts pip installable. |
Sorry, something went wrong.
|
Closing; see issue. |
Sorry, something went wrong.
| Back | FazBrowse Home | New Git URL |
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.