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)