This commit is contained in:
Anthony Sottile 2025-11-07 17:02:17 -05:00
parent 65175f3cf3
commit 37e2ba87a7
13 changed files with 134 additions and 0 deletions

16
pre_commit/tool_base.py Normal file
View file

@ -0,0 +1,16 @@
from __future__ import annotations
from typing import Protocol
from pre_commit.prefix import Prefix
class Tool(Protocol):
# "special" versions which can be resolved
@property
def RESOLVABLE(self) -> tuple[str, ...]: ...
# TODO: what if not resolvable? (no current examples?)
def resolve(self, version: str) -> str: ...
def install(self, prefix: Prefix, version: str) -> None: ...
def health_check(self, prefix: Prefix, version: str) -> str | None: ...
# TODO: how to env patch?