Skip to content

Commit dd9827b

Browse files
authored
Specfy pre-commit-uv and uv version in --version (#7)
1 parent 72048c7 commit dd9827b

File tree

2 files changed

+12
-1
lines changed

2 files changed

+12
-1
lines changed

pyproject.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ paths.source = [
118118
"**/src",
119119
"**\\src",
120120
]
121-
report.fail_under = 65
121+
report.fail_under = 63
122122
run.parallel = true
123123
run.plugins = [
124124
"covdefaults",

src/pre_commit_uv/__init__.py

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,17 @@ def _patch() -> None:
2323
from pre_commit import main # noqa: PLC0415
2424

2525
_original_main, main.main = main.main, _new_main
26+
if "--version" in sys.argv:
27+
from importlib.metadata import version as _metadata_version # noqa: PLC0415
28+
29+
from pre_commit import constants # noqa: PLC0415
30+
31+
constants.VERSION = (
32+
f"{constants.VERSION} ("
33+
f"pre-commit-uv={_metadata_version('pre-commit-uv')}, "
34+
f"uv={_metadata_version('uv')}"
35+
f")"
36+
)
2637

2738

2839
def _new_main(argv: list[str] | None = None) -> int:

0 commit comments

Comments
 (0)