refactor: AgentProvider.dockerfile always returns Path, never None
lint / lint (push) Failing after 1m50s
test / unit (pull_request) Successful in 40s
test / integration (pull_request) Successful in 59s

The convention is that every provider declares a Dockerfile location;
callers that care whether the file actually exists check .is_file().
Drops all `is not None` guards on the property result.
This commit is contained in:
2026-06-08 06:06:51 +00:00
parent 41590ede1f
commit e0ecb7ceb1
4 changed files with 15 additions and 24 deletions
+5 -8
View File
@@ -128,16 +128,13 @@ class AgentProvider(ABC):
template."""
@property
def dockerfile(self) -> Path | None:
"""Path to the provider's Dockerfile, or None if no Dockerfile
is declared.
def dockerfile(self) -> Path:
"""Path to the provider's Dockerfile.
Default: looks for a `Dockerfile` file next to this provider's
Default: the `Dockerfile` file next to this provider's
`agent_provider.py` module. Override to point at a non-standard
path, or return None to signal that no Dockerfile exists (the
provider relies on a pre-built image)."""
path = Path(inspect.getfile(type(self))).parent / "Dockerfile"
return path if path.is_file() else None
path."""
return Path(inspect.getfile(type(self))).parent / "Dockerfile"
@abstractmethod
def provision_plan(