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
Won't run on Windows #159
Comments
Unfortunately I think windows support is pretty far from working due to the following things: Minimal to run a python based hook:
The nice to haves that I don't know will work:
|
Understood ;( |
I started trying to get some of tests to pass here: https://github.com/pre-commit/pre-commit/tree/windoze The first wall I'm hitting is symlinks, which require elevated privileges by default under windows (wtf). I might rethink the one place I'm using symlinks and swap in something like sqlite instead (which might actually make everything simpler?). For xargs, etc. I think I can depend on powershell (who would develop on windows without powershell amirite?). Here's some recipes I found from googling: http://five.agency/powershell-tips-for-bash-users/ |
So I don't forget next time: pytest does not handle coloring well under powershell, use this in pytest.ini:
|
Using git-shell (from github's windows downloads), I have pre-commit running! A bunch of the tests fail however and I'm not convinced that using github's tools constitutes supporting windows. But worst-case you can start using some of the hooks. I'm going to keep working on this branch and get more things passing. |
I think it's fair to document git-shell as a dependency. There's also MinGW, cygwin. I think git-shell is a customized mingw. |
Fixed via #196 @quentindemetz let me know if this works for you |
@asottile git-shell is not supported on Windows XP, which is what I'm developing on…too bad |
What implementation of git are you using? |
I think it's msysgit
I don't know where to find the log mentioned in the last line:
Thanks |
I'm going to grab a VM and see if I can reproduce this. |
Ah I see the issue. Under Windows XP, msysgit's install doesn't provide an executable named |
I in fact do have some version of bash installed (I think I also have git bash installed, I'm not quite sure how to tell which is which).
Running the command manually doesn't give many hints:
|
Looks like there is no py_env in the 'C:\Documents and Settings\IEUser.pre-commit\repoobvhtq' folder. |
Is that running with git bash as your shell or cmd as your shell? |
With cmd. Thanks ! Will use git bash from now on ! (for reference here is the pep8 issue I'm getting)
|
Just fixed the pep8 conflict here: pre-commit/pre-commit-hooks@4078cbe |
Fantastic, was just about to upgrade to the latest release of that repo, looks like I'll need to go as far as HEAD then. Thanks a million |
I'm releasing 0.4.1 right now :) |
😍 |
This might be a stupid idea, but is it possible to embed bash in pre-commit to remove that dependency on windows? |
It'd be possible, but I'd rather not bundle all of msysgit when on windows I can expect most if not all of it to be installed :) (plus then I'd have to deal with the licensing issue) |
I just want it to work in http://bliker.github.io/cmder/ on windows :( (though it's possible it does actually work and I'm just doing something wrong) When I try to use pre-commit in cmder I get this even though cmder supposedly has msysgit bundled in:
|
@guykisel the latest version factors out bash and xargs so it should function better in cmder (0.8.0) |
@asottile awesome! I'll give it a shot on Monday. |
I'm getting the following traceback:
The text was updated successfully, but these errors were encountered: