-
Notifications
You must be signed in to change notification settings - Fork 22
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
Pipenv mode is broken by the --split-string (-S) argument of env in the shebang #42
Comments
Not sure which Ubuntu version you are using. At least Ubuntu 19.04 and 19.10 have a sufficient env version. Because I did use these versions for development.
Personally I wasn't aware that the -S option was added in one of the last versions :-/ I guess a workaround for you would be to change the shebang line to use pipenv directly. |
The -S param got introduced with coreutils 8.30 (2018-07-01) https://github.com/coreutils/coreutils/blob/master/NEWS#L241 |
I am also running into this issue on Ubuntu 18.04 in WSL on Windows.
I have replaced: I still run into the following issues:
or even when I manually run
Console Output:
|
Yes the mode is unknown because the shebang line is used to determine the current mode of the hook |
Regarding the autopep8 plugin please create an issue in the plugin repo because I am not the author of this plugin. |
Have you considered a solution like pipenv-shebang? Using it as a replacement worked for me. The only downside is that it must be installed globally on the system, something I am not always in favor of. |
This whole mode thing is for avoiding global installation of python modules. My intention was to only install a minimal git hook. With the first version of autohooks the user had to handle the dependencies by himself. But this didn't work out. Therefore version 2 got different modes to handle dependencies loading but I wasn't aware that Currently I am thinking of installing a bootstrap python module besides hook to solve the different loading modes. This module may contain something like pipenv-shebang then. |
@bjoernricks @y0urself As #89 has been merged as a fix i guess this issue can be closed now? |
Yes. Thanks! |
Hi,
I found myself stuck for an hour trying to make the pipenv mode work. This made me take a look at the pre-commit script managed by autohooks.
I noticed that the
--split-string
(-S
) argument of env (coreutils) is used in the shebang. But it doesn't seem to be available in every version of/usr/bin/env
and using it breakspipenv
mode for me.The change was brought by this commit.
My platform information
My
env
versionThe error I get
From a pipenv virtualenv:
This is because the shebang used in the pre-commit script managed by autohooks is
#!/usr/bin/env -S pipenv run python3
.The whole script content is:
Workaround
The only way for me to make it work for now is to force the
pythonpath
mode which rewrites the shebang of the previous script to#!/usr/bin/env python3
Questions/Recommandations
What are your recommandation for this problem?
I assume that upgrading my
/usr/bin/env
version should solve everything but maybe a minimum requirement should be explicitly mentioned in the install doc.I found this interesting issue about pipenv shebang and it seems like
-S
is not available on Ubuntu. Is it a choice to makepipenv
mode unavailable on Ubuntu?The text was updated successfully, but these errors were encountered: