refactor: use dataclasses vs. NamedTuples

This commit is contained in:
Henry Schreiner
2022-04-28 11:41:47 -04:00
parent de07370930
commit 98fedb7e51
11 changed files with 60 additions and 53 deletions
+4 -2
View File
@@ -1,5 +1,6 @@
import subprocess
from typing import Callable, Dict, List, NamedTuple, Optional, Sequence
from dataclasses import dataclass
from typing import Callable, Dict, List, Optional, Sequence
import bashlex
@@ -13,7 +14,8 @@ def local_environment_executor(command: List[str], env: Dict[str, str]) -> str:
).stdout
class NodeExecutionContext(NamedTuple):
@dataclass(frozen=True)
class NodeExecutionContext:
environment: Dict[str, str]
input: str
executor: EnvironmentExecutor