-
-
Notifications
You must be signed in to change notification settings - Fork 843
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
pre-commit hook with language version language_version: python2.7 is not working #2062
Comments
exit code |
pre-compile works fine if don't mention language_version, on Python 3. Doubt it's a memory issue.
Anything else I can try? |
try this: git clone https://gitlab.com/pycqa/flake8
cd flake8
git checkout 3.9.2
virtualenv venv -ppython2.7
venv/bin/pip install . that's basically all that pre-commit does |
seems to be working, last few lines of last step. What next?
|
can you show all the output of all the commands? |
|
hmmm maybe try this instead? it's more exact to what pre-commit runs: git clone https://gitlab.com/pycqa/flake8
cd flake8
git checkout 3.9.2
WD="$PWD"
cd / && virtualenv "$wd/venv" -p python2.7 && cd "$WD"
. venv/bin/activate
python -m pip install . |
looks good. Changed wd in capital here -> cd / && virtualenv "$wd/venv" -p python2.7 && cd "$WD"
|
does it reproduce as well when you do the cloning inside of |
yes, looks good in there too.
|
what if you use the |
I didn't get it. Use |
ah I was meaning more to use the but yeah maybe try |
I ran these, inside
|
does it work with non-brew |
I think I am able to reproduce it. What you think I can fix this? Used virtualenv python path in last install step
|
maybe check |
Result in killed process
Able to install successfully
Is pre-commit picking wrong version of virtualenv or python? What you suggest with these info?
|
pre-commit installed via brew will use the utilities installed adjacent to pre-commit inside its little environment so the versions it uses makes sense to me were you ever able to try it without brew? using a pre-commit installed to a virtualenv outside? |
will you be able to give steps/command for it? Not exactly sure how to do that. |
or something of the sort |
pyenv I working on has two virtual evns, python version 2.7.18 and 3.8.5 pre-commit 1.21.0 version is installed in virtual env python 2.7.18
pre-commit 2.15.0 version is installed in virtual env python 3.8.5 Trying to uninstall pre-commit from brew, If git commit invoke pre-commit from virtual env of 3.8.5 it will be great. Or there should be other way to default to pre-commit of virtualenv ? |
ah you'll have to make a python3+ virtualenv for |
Ok. Here is what I did Looks good so far. |
@manishsharma64 I'm having a similar problem with
Can you explain how you set the path for |
I wasn't able to reproduce the metioned solution and digged a little deeper into this. It looks like this is more an issue with python3 virtualenv creating a python2 env. see |
describe your issue
Getting attached error. I am on Mac OS, M1 machine
Tried after clean cache using
pre-comple clean
as well.Using language version of python3 is not an option.
pre-commit --version
2.15.0
.pre-commit-config.yaml
~/.cache/pre-commit/pre-commit.log (if present)
version information
error information
The text was updated successfully, but these errors were encountered: