make in_env part of the language api

This commit is contained in:
Anthony Sottile 2023-01-02 19:02:38 -05:00
parent bcf0230772
commit ae34a962d7
23 changed files with 73 additions and 92 deletions

View file

@ -1,5 +1,6 @@
from __future__ import annotations
from typing import ContextManager
from typing import Protocol
from typing import Sequence
@ -50,6 +51,14 @@ class Language(Protocol):
) -> None:
...
# modify the environment for hook execution
def in_env(
self,
prefix: Prefix,
version: str,
) -> ContextManager[None]:
...
# execute a hook and return the exit code and output
def run_hook(
self,