Skip to content

Proposal: Support python -m prek execution #1685

@uplsh580

Description

@uplsh580

Summary

prek can currently only be run via the prek command and does not work with python -m prek. Please add support for running prek as a Python module.

Motivation

  • Consistency: Many Python CLI tools (e.g. black, ruff, uv) support python -m <package>.
  • Virtual environments: python -m prek makes it clear which Python interpreter (and thus which venv) is used.
  • Scripts and CI: Using python -m prek makes the execution environment explicit.
  • IDE and tool integration: Some tools only support the python -m form.

(I am willing to submit a PR)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions