-
Notifications
You must be signed in to change notification settings - Fork 100
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
installing hook on pre-commit fails with newest virtualenv (>20.24.5) present #535
installing hook on pre-commit fails with newest virtualenv (>20.24.5) present #535
Comments
It looks like there is a problem with new pip version. The obvious fix is: Probably it's somehow related to this new feature: pypa/pip#11924 |
I got this issue with Command to apply the fix from @KochankovID: $(brew --prefix)/opt/pre-commit/libexec/bin/python3 -m pip install virtualenv==v20.24.5 |
I can not use the - repo: https://github.com/jorisroovers/gitlint
rev: v0.19.1
hooks:
- id: gitlint
additional_dependencies: [gitlint-core==v0.9.1]
stages: [commit-msg] |
Upon further testing, my solution seems to cause a version conflict when actually running the hook install. Embarrassingly I was fooled by running |
20.24.7 fails as well. |
Rather than posting here, please test and add details to pypa/pip#12372 so pip developers prioritize user needs |
Should we ask pre-commit to pin virtualenv to <=20.24.5 until virtualenv includes a new version of pip without the regression? Or ask pypa to revert the pip change in virtualenv. |
I doubt you'll have much luck with either. This needs to be fixed in pip |
Includes a fix for jorisroovers/gitlint#535.
Note: we do not upgrade gitlint to 0.19.x because of jorisroovers/gitlint#535
Verification of git message is failing because of a pip installation issue: jorisroovers/gitlint#535 pypa/pip#12372 The issue has been addressed for pip v23.3.2: https://github.com/pypa/pip/releases/tag/23.3.2 but the virtual environment for the pre-commit hook does not appear to have the version available yet. Run the gitlint with tox directly until the issue is resolved in the Jenkins environment. Change-Id: I033240f8f7bb5a14217dbc763687ac490ae4b3d0 Signed-off-by: Sangwook Ha <sangwook.ha@verizon.com>
I mentioned it in pypa/pip#12372 (comment), but it should be possible to workaround this issue by telling virtualenv the version of pip to use when seeding the venvs:
Only necessary until virtualenv either updates the pip package on its schedule or provides 23.3.2+ by default. |
My workaround (that actually works this time) was to go to the pre-commit git repo for gitlint on my disk, and download the tags for the repository. This allowed
Fallback configuration is documented for setuptools-scm in the configuration parameters, and updating it could be rolled into the release tagging process. Or, the fallback could be set to something sane but conservative, like the latest major version. |
New virtualenv tag that bumps pip to 24.0 https://github.com/pypa/virtualenv/releases/tag/20.25.1. |
@vfazio as in that version of pip fixes this bug? |
pip 23.3.2 technically fixed it, but no version of virtualenv was tagged with that version (though it would have slowly picked up the new pip at some point due to it's internal update policy). virtualenv now specifically embeds 24.0, which includes the fix as well. |
For reference: pypa/pip@69b5810 |
So I'll close this then. The resolution being either
|
virtualenv 20.24.6 updates embed setuptools from 6.2.0 to 6.2.2 and pip to 23.3.1
pip 23.3 includes some changes to dependency resolution, so that's what might cause the issue.
Pre-commit config:
results of running on a clean pre-commit env (cleared pre-commit cache)
The text was updated successfully, but these errors were encountered: