Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Pip v22 breaks pre-commit on Windows #10931

Closed
1 task done
john-adamson opened this issue Mar 2, 2022 · 4 comments
Closed
1 task done

Pip v22 breaks pre-commit on Windows #10931

john-adamson opened this issue Mar 2, 2022 · 4 comments
Labels
resolution: wrong project Should be reported elsewhere type: bug A confirmed bug or unintended behavior

Comments

@john-adamson
Copy link

Description

Pre-commit no longer works on Windows when using Pip v22

Expected behavior

If pre-commit is installed it should be able to add a Git hook to the .git/hooks folder.
Additionally, running the pre-commit command should produce output.

pip version

22

Python version

3.10

OS

Windows 10

How to Reproduce

  1. Install Python 3.10 and Git (including Git Bash) on Windows 10
  2. Open Git Bash
  3. Run:
$ mkdir precommittest
$ cd precommittest
$ <path to installed python exe> -m venv venv
$ . ./venv/Scripts/activate
$ python -m pip install pip --upgrade
$ python -m pip install pre-commit
$ pre-commit sample-config > .pre-commit-config.yaml
$ pre-commit install
$ pre-commit run --all-files

The final two lines will do nothing with Pip v22.

If the python -m pip install pip --upgrade step is skipped then pre-commit will work as expected.

Output

There will be no output using Pip v22 (but there should be).

Code of Conduct

@john-adamson john-adamson added S: needs triage Issues/PRs that need to be triaged type: bug A confirmed bug or unintended behavior labels Mar 2, 2022
@uranusjr
Copy link
Member

uranusjr commented Mar 2, 2022

Please report to pre-commit for the issue. pip maintainers don’t understand how pre-commit install works and can’t provide meaningful support without input from pre-commit. Feel free to report back and reopen if pre-commit identifies more information on how the issue related to pip.

@uranusjr uranusjr closed this as completed Mar 2, 2022
@uranusjr uranusjr added the resolution: wrong project Should be reported elsewhere label Mar 2, 2022
@john-adamson
Copy link
Author

@pradyunsg
Copy link
Member

This is likely #10875 on our end.

@pradyunsg pradyunsg removed the S: needs triage Issues/PRs that need to be triaged label Mar 2, 2022
@john-adamson
Copy link
Author

Note that for an existing .pre-commit-config.yaml (rather than the example given above) the pre-commit install doesn't even copy to .git/hooks

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 2, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
resolution: wrong project Should be reported elsewhere type: bug A confirmed bug or unintended behavior
Projects
None yet
Development

No branches or pull requests

3 participants