Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions snakemake_interface_software_deployment_plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -312,6 +312,16 @@ def pinfile(self) -> Path:
self.pinfile_extension()
)

def remove_pinfile(self) -> None:
"""Remove the pinfile."""
if self.pinfile.exists():
try:
self.pinfile.unlink()
except Exception as e:
raise WorkflowError(
f"Removal of pinfile {self.pinfile} failed: {e}"
) from e


class CacheableEnvBase(EnvBase, ABC):
async def get_cache_assets(self) -> Iterable[str]: ...
Expand Down Expand Up @@ -340,7 +350,7 @@ async def remove_cache(self) -> None:
except Exception as e:
raise WorkflowError(
f"Removal of cache asset {asset_path} for {self.spec} failed: {e}"
)
) from e


class DeployableEnvBase(EnvBase, ABC):
Expand Down Expand Up @@ -385,13 +395,13 @@ def managed_remove(self) -> None:
try:
self.remove()
except Exception as e:
raise WorkflowError(f"Removal of {self.spec} failed: {e}")
raise WorkflowError(f"Removal of {self.spec} failed: {e}") from e

async def managed_deploy(self) -> None:
try:
await self.deploy()
except Exception as e:
raise WorkflowError(f"Deployment of {self.spec} failed: {e}")
raise WorkflowError(f"Deployment of {self.spec} failed: {e}") from e

def deployment_hash(self) -> str:
return self._managed_generic_hash("deployment_hash")
Expand Down