(self, notebook_path: str)
| 50 | self._envs: dict[tuple[str, ...], tuple[str, str]] = {} |
| 51 | |
| 52 | def get_python(self, notebook_path: str) -> str: |
| 53 | from marimo._cli.sandbox import ( |
| 54 | build_sandbox_venv, |
| 55 | get_sandbox_requirements, |
| 56 | ) |
| 57 | |
| 58 | requirements = tuple(get_sandbox_requirements(notebook_path)) |
| 59 | existing = self._envs.get(requirements) |
| 60 | if existing is not None: |
| 61 | return existing[1] |
| 62 | |
| 63 | sandbox_dir, venv_python = build_sandbox_venv(notebook_path) |
| 64 | self._envs[requirements] = (sandbox_dir, venv_python) |
| 65 | return venv_python |
| 66 | |
| 67 | def close(self) -> None: |
| 68 | from marimo._cli.sandbox import cleanup_sandbox_dir |
no test coverage detected