Skip to content

Wrong shebang line generated for my setyp (Windows10 + pyenv-win + pre-commit installed in virtual env) #1583

@Celeborn2BeAlive

Description

@Celeborn2BeAlive

pre-commit generates the following shebang in the hook:

#!/usr/bin/env python.exe

It works when I have a virtual env activated, but not outside because I install python with pyenv-win that makes python accessible through a python shim installed in %USERPROFILE%\.pyenv\pyenv-win\shims\python.

Right now my workaround is to edit manually the hook and replace "python.exe" with "python". I don't want to change my PATH to have "python.exe" accessible from it because I may change the global python I use with pyenv and I would have to remember to update my PATH in that case.

Is there a command line argument to specify the command to use in the shebang ? (I don't see any with pre-commit --help or pre-commit install --help). If not do you think it would be a good idea to offer such option ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions