From: Joerg Behrmann Date: Tue, 21 Feb 2023 13:34:43 +0000 (+0100) Subject: tighten typing of env variable passed to run functions X-Git-Tag: v15~318 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a657c45d7265fecc60ff0bcf25543ef231488245;p=thirdparty%2Fmkosi.git tighten typing of env variable passed to run functions --- diff --git a/mkosi/distributions/debian.py b/mkosi/distributions/debian.py index 60cc8b98d..904303729 100644 --- a/mkosi/distributions/debian.py +++ b/mkosi/distributions/debian.py @@ -292,7 +292,7 @@ def invoke_apt( operation, *extra, ] - env = dict( + env: dict[str, PathString] = dict( APT_CONFIG=config_file, DEBIAN_FRONTEND="noninteractive", DEBCONF_INTERACTIVE_SEEN="true", diff --git a/mkosi/run.py b/mkosi/run.py index d629fcf0c..70a0fa819 100644 --- a/mkosi/run.py +++ b/mkosi/run.py @@ -193,7 +193,7 @@ def run( check: bool = True, stdout: _FILE = None, stderr: _FILE = None, - env: Mapping[str, Any] = {}, + env: Mapping[str, PathString] = {}, **kwargs: Any, ) -> CompletedProcess: cmdline = [os.fspath(x) for x in cmdline] @@ -247,7 +247,7 @@ def run_with_apivfs( cmd: Sequence[PathString], bwrap_params: Sequence[PathString] = tuple(), stdout: _FILE = None, - env: Mapping[str, Any] = {}, + env: Mapping[str, PathString] = {}, ) -> CompletedProcess: cmdline: list[PathString] = [ "bwrap", @@ -283,7 +283,7 @@ def run_workspace_command( bwrap_params: Sequence[PathString] = tuple(), network: bool = False, stdout: _FILE = None, - env: Mapping[str, Any] = {}, + env: Mapping[str, PathString] = {}, ) -> CompletedProcess: cmdline: list[PathString] = [ "bwrap",