diff --git a/pyproject.toml b/pyproject.toml index f08760d..d00d236 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -81,3 +81,30 @@ python_version = "3.9" warn_return_any = true warn_unused_configs = true disallow_untyped_defs = true + +# The backend modules import optional 3rd-party sandbox SDKs (`e2b_code_interpreter`, +# `daytona`, `boxlite`) that don't ship type stubs. Without overrides, mypy types +# those imports as `object` and then flags every attribute access on the SDK +# clients. Each backend is exercised by its own integration tests against the +# real SDK; suppress the missing-stub noise so static checks don't block CI. +[[tool.mypy.overrides]] +module = [ + "e2b_code_interpreter", + "e2b.sandbox.commands.command_handle", + "daytona", + "boxlite", + "boxlite.sync_api", +] +ignore_missing_imports = true + +# The backend modules consume the SDKs above as untyped Any. disallow_untyped_defs +# + warn_return_any cascade into noise. Disable strict checks for these files only. +[[tool.mypy.overrides]] +module = [ + "sandrun.backends.e2b", + "sandrun.backends.daytona", + "sandrun.backends.boxlite", +] +disallow_untyped_defs = false +warn_return_any = false +disable_error_code = ["attr-defined", "no-any-return"] diff --git a/src/sandrun/_micromamba.py b/src/sandrun/_micromamba.py index 66088a6..aa80ed8 100644 --- a/src/sandrun/_micromamba.py +++ b/src/sandrun/_micromamba.py @@ -143,6 +143,7 @@ def resolve_micromamba() -> tuple[str | None, bool]: explicit = os.environ.get("SANDRUN_MICROMAMBA_PATH") or os.environ.get( "METAFLOW_SANDBOX_MICROMAMBA_PATH" ) + path: str | None if explicit: path = explicit compatible = is_compatible_linux_micromamba(path) diff --git a/src/sandrun/backends/__init__.py b/src/sandrun/backends/__init__.py index b25723a..84eaccd 100644 --- a/src/sandrun/backends/__init__.py +++ b/src/sandrun/backends/__init__.py @@ -45,4 +45,5 @@ def get_backend(name: str) -> SandboxBackend: module = importlib.import_module(module_path, package=__name__) cls = getattr(module, class_name) - return cls() + instance: SandboxBackend = cls() + return instance diff --git a/src/sandrun/installer.py b/src/sandrun/installer.py index d3f3813..2f227c4 100644 --- a/src/sandrun/installer.py +++ b/src/sandrun/installer.py @@ -336,6 +336,10 @@ class UvDepInstaller(DepInstaller): _MANIFEST_NAME = "sandrun-uv-manifest.txt" + # Set by _from_pep723_path() when the installer is built from an inline- + # metadata PEP 723 script. None for the regular requirements-list flow. + _script_path: str | None = None + def __init__(self, staging_dir: str | None = None) -> None: if staging_dir is None: self._staging_dir = tempfile.mkdtemp(prefix="sandrun-uv-deps-")