Skip to content

Commit

Permalink
Specfy pre-commit-uv and uv version in --version (#7)
Browse files Browse the repository at this point in the history
  • Loading branch information
gaborbernat authored Aug 12, 2024
1 parent 72048c7 commit dd9827b
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ paths.source = [
"**/src",
"**\\src",
]
report.fail_under = 65
report.fail_under = 63
run.parallel = true
run.plugins = [
"covdefaults",
Expand Down
11 changes: 11 additions & 0 deletions src/pre_commit_uv/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,17 @@ def _patch() -> None:
from pre_commit import main # noqa: PLC0415

_original_main, main.main = main.main, _new_main
if "--version" in sys.argv:
from importlib.metadata import version as _metadata_version # noqa: PLC0415

from pre_commit import constants # noqa: PLC0415

constants.VERSION = (
f"{constants.VERSION} ("
f"pre-commit-uv={_metadata_version('pre-commit-uv')}, "
f"uv={_metadata_version('uv')}"
f")"
)


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

0 comments on commit dd9827b

Please sign in to comment.