Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 2 additions & 0 deletions snakemake_interface_software_deployment_plugins/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -169,6 +169,7 @@ def __init__(
settings: Optional[SoftwareDeploymentSettingsBase],
shell_executable: ShellExecutable,
tempdir: Path,
source_cache: Path,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🔴 Critical

🧩 Analysis chain

Verify usage of source_cache across the codebase.

The parameter is added but not visibly used within this file. Confirm that plugins or downstream code will consume this attribute.


🏁 Script executed:

#!/bin/bash
# Search for usages of source_cache in the codebase
rg -n -C3 'source_cache' --type=py

Length of output: 3482


Remove or implement usage of source_cache.
The source_cache parameter is assigned but never referenced elsewhere. Remove it or add the intended functionality and document its purpose.

🤖 Prompt for AI Agents
In snakemake_interface_software_deployment_plugins/__init__.py around line 172,
the function signature includes a source_cache: Path parameter that is assigned
but never used; either remove the parameter from the signature and any callers
and update docs/tests accordingly, or implement its intended behavior by adding
logic to use source_cache for caching downloaded/processed source artifacts
(e.g., check for an existing cached file there, read from it when present, and
write newly fetched sources into it) and add a docstring comment explaining its
purpose and format; update unit tests and call sites to reflect the chosen
change.

cache_prefix: Path,
deployment_prefix: Path,
pinfile_prefix: Path,
Expand All @@ -178,6 +179,7 @@ def __init__(
self.settings: Optional[SoftwareDeploymentSettingsBase] = settings
self.shell_executable = shell_executable
self.tempdir = tempdir
self.source_cache: Path = source_cache
self._deployment_prefix: Path = deployment_prefix
self._cache_prefix: Path = cache_prefix
self._pinfile_prefix: Path = pinfile_prefix
Expand Down
3 changes: 3 additions & 0 deletions snakemake_interface_software_deployment_plugins/tests.py
Original file line number Diff line number Diff line change
Expand Up @@ -152,17 +152,20 @@ def _get_env(self, tmp_path) -> EnvBase:
deployment_prefix = tmp_path / "deployments"
cache_prefix = tmp_path / "cache"
pinfile_prefix = tmp_path / "pinfiles"
source_cache = tmp_path / "source_cache"
tempdir.mkdir(parents=True, exist_ok=True)
deployment_prefix.mkdir(parents=True, exist_ok=True)
cache_prefix.mkdir(parents=True, exist_ok=True)
pinfile_prefix.mkdir(parents=True, exist_ok=True)
source_cache.mkdir(parents=True, exist_ok=True)

return env_cls(
spec=spec,
within=None,
settings=self.get_settings(),
shell_executable=self.shell_executable,
tempdir=tempdir,
source_cache=source_cache,
deployment_prefix=deployment_prefix,
cache_prefix=cache_prefix,
pinfile_prefix=pinfile_prefix,
Expand Down