From 21fbea865475d2de688c84883cf22e7cc39a128a Mon Sep 17 00:00:00 2001 From: Kemal Akkoyun Date: Wed, 5 Jun 2024 22:38:52 +0200 Subject: [PATCH] feat(container): Add requirements property in case specified (#142) --- src/isolate/backends/container.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/isolate/backends/container.py b/src/isolate/backends/container.py index afa9aea..aeacac6 100644 --- a/src/isolate/backends/container.py +++ b/src/isolate/backends/container.py @@ -17,6 +17,7 @@ class ContainerizedPythonEnvironment(BaseEnvironment[Path]): image: dict[str, Any] = field(default_factory=dict) python_version: str | None = None + requirements: list[str] = field(default_factory=list) tags: list[str] = field(default_factory=list) @classmethod @@ -34,7 +35,7 @@ def key(self) -> str: # dockerfile_str is always there, but the validation is handled by the # controller. dockerfile_str = self.image.get("dockerfile_str", "") - return sha256_digest_of(dockerfile_str, *sorted(self.tags)) + return sha256_digest_of(dockerfile_str, *self.requirements, *sorted(self.tags)) def create(self, *, force: bool = False) -> Path: return Path(sys.exec_prefix)