tox-dev / pre-commit-uv

MIT License
40 stars 1 forks source link

Error running pre-commit after pre-commit-uv install #4

Open owenlamont opened 1 month ago

owenlamont commented 1 month ago

I'm running on Windows 11 and have both pre-commit and uv installed with pipx. I followed the pipx instructions to inject install pre-commit-uv then tried deleting my pre-commit cache and running pre-commit on a repo to receive this error:

[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Using pre-commit with uv 0.2.34 via pre-commit-uv 4.0.2
An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\Owen\\.local\\pipx\\venvs\\pre-commit\\Scripts\\uv.exe', 'venv', 'C:\\Users\\Owen\\.cache\\pre-commit\\repoj03weecx\\py_env-default')
return code: 1
stdout: (none)
stderr:
      × No interpreter found in system path or `py` launcher
Check the log at C:\Users\Owen\.cache\pre-commit\pre-commit.log
gaborbernat commented 1 month ago

Sounds like a UV bug 🥲

gaborbernat commented 1 month ago

Fixed now give it a try again.

owenlamont commented 1 month ago

Thanks for trying to resolve this so fast. Still no joy though 😞 4.0.3 gives me the same problem.

pre-commit run --all-files
[INFO] Initializing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Initializing environment for https://github.com/igorshubovych/markdownlint-cli.
[INFO] Initializing environment for https://github.com/charliermarsh/ruff-pre-commit.
[INFO] Initializing environment for https://github.com/crate-ci/typos.
[INFO] Initializing environment for https://github.com/rtts/djhtml.
[INFO] Initializing environment for https://github.com/adrienverge/yamllint.git.
[INFO] Installing environment for https://github.com/pre-commit/pre-commit-hooks.
[INFO] Once installed this environment will be reused.
[INFO] This may take a few minutes...
[INFO] Using pre-commit with uv 0.2.34 via pre-commit-uv 4.0.3
An unexpected error has occurred: CalledProcessError: command: ('C:\\Users\\Owen\\.local\\pipx\\venvs\\pre-commit\\Scripts\\uv.exe', 'venv', 'C:\\Users\\Owen\\.cache\\pre-commit\\repobsvszmp6\\py_env-default')
return code: 1
stdout: (none)
stderr:
      × No interpreter found in system path or `py` launcher
Check the log at C:\Users\Owen\.cache\pre-commit\pre-commit.log

I've attached the full pre-commit.log if that helps.