Skip to content

Calling pre-commit --version as a module confuses it about its name #1273

@ssbarnea

Description

@ssbarnea

I found a minor bug in pre-commit which reports __main__.py instead of pre-commit when is asked about its version using module calling.

python -m pre_commit --version
__main__.py 1.20.0

I would be nice to find a solution for it as I observed this issue on other projects too. Still, it seems that tools like pip, virtualenv, tox or pytest are not affected by this bug.

Calling tools as python modules is quite common on CI as it avoids two common issues: exec install path not in in PATH, wrong python interpreter would be used.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions