feat: add support for python -m prek#1686
Conversation
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #1686 +/- ##
==========================================
- Coverage 91.65% 91.59% -0.06%
==========================================
Files 96 96
Lines 18665 18880 +215
==========================================
+ Hits 17107 17294 +187
- Misses 1558 1586 +28 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Actually, This comment motivated me to open this PR. |
f0c95a1 to
0275d27
Compare
|
I think the |
📦 Cargo Bloat ComparisonBinary size change: +0.00% (23.8 MiB → 23.8 MiB) Expand for cargo-bloat outputHead Branch ResultsBase Branch Results |
|
Thanks! |

Related Issue: #1685
Summary
prek can now be run with python -m prek in addition to the prek command, matching common Python CLI tools like
black,ruff, anduv.Motivation
python -mformChanges
python/prek/package with__init__.pyand__main__.pypyproject.tomlso maturin includes the Python package__main__.py invokes the prek binary next to the Python executable (e.g..venv/bin/prek with .venv/bin/python), falling back to PATH if not found