Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Download: Add apptainer to the list of false positve container strings #2353

Merged
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
- Refactored the CLI parameters related to container images. Although downloading other images than those of the Singularity/Apptainer container system is not supported for the time being, a generic name for the parameters seemed preferable. So the new parameter `--singularity-cache-index` introduced in [#2247](https://github.com/nf-core/tools/pull/2247) has been renamed to `--container-cache-index` prior to release ([#2336](https://github.com/nf-core/tools/pull/2336)).
- To address issue [#2311](https://github.com/nf-core/tools/issues/2311), a new parameter `--container-library` was created allowing to specify the container library (registry) from which container images in OCI format (Docker) should be pulled ([#2336](https://github.com/nf-core/tools/pull/2336)).
- Container detection in configs was improved. This allows for DSL2-like container definitions inside the container parameter value provided to process scopes [#2346](https://github.com/nf-core/tools/pull/2346).
- Add apptainer to the list of false positve container strings ([#2353](https://github.com/nf-core/tools/pull/2353)).

#### Updated CLI parameters

Expand Down
5 changes: 2 additions & 3 deletions nf_core/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -733,8 +733,7 @@ def find_container_images(self, workflow_directory):
re.DOTALL is used to account for the string to be spread out across multiple lines.
"""
container_regex = re.compile(
r"container\s+[\s{}=$]*(?P<quote>[\'\"])(?P<param>(?:.(?!\1))*.?)\1[\s}]*",
re.DOTALL,
r"container\s+[\s{}=$]*(?P<quote>[\'\"])(?P<param>(?:.(?!\1))*.?)\1[\s}]*", re.DOTALL
)

local_module_findings = re.findall(container_regex, search_space)
Expand Down Expand Up @@ -850,7 +849,7 @@ def rectify_raw_container_matches(self, raw_findings):

for _, capture in container_value_defs:
# common false positive(s)
if capture in ["singularity"]:
if capture in ["singularity", "apptainer"]:
continue

# Look for a http download URL.
Expand Down