Thanks to visit codestin.com
Credit goes to github.com

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
7 changes: 5 additions & 2 deletions nf_core/lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -557,7 +557,8 @@ def check_conda_dockerfile(self):
expected_strings = [
'FROM nfcore/base',
'COPY environment.yml /',
'RUN conda env update -n root -f /environment.yml && conda clean -a'
'RUN conda env create -f /environment.yml && conda clean -a',
'ENV PATH /opt/conda/envs/{}/bin:$PATH'.format(self.conda_config['name'])
]

difference = set(expected_strings) - set(self.dockerfile)
Expand All @@ -581,8 +582,10 @@ def check_conda_singularityfile(self):
'From:nfcore/base',
'Bootstrap:docker',
'VERSION {}'.format(self.config['params.version'].strip(' \'"')),
'PATH=/opt/conda/envs/{}/bin:$PATH'.format(self.conda_config['name']),
'export PATH',
'environment.yml /',
'/opt/conda/bin/conda env update -n root -f /environment.yml',
'/opt/conda/bin/conda env create -f /environment.yml',
'/opt/conda/bin/conda clean -a',
]

Expand Down
3 changes: 2 additions & 1 deletion tests/lint_examples/minimal_working_example/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,5 @@ LABEL authors="[email protected]" \
description="Docker image containing all requirements for the nf-core tools pipeline"

COPY environment.yml /
RUN conda env update -n root -f /environment.yml && conda clean -a
RUN conda env create -f /environment.yml && conda clean -a
ENV PATH /opt/conda/envs/nfcore-tools-0.4/bin:$PATH
6 changes: 5 additions & 1 deletion tests/lint_examples/minimal_working_example/Singularity
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,13 @@ Bootstrap:docker
DESCRIPTION Container image containing all requirements for the nf-core/tools pipeline
VERSION 0.4

%environment
PATH=/opt/conda/envs/nfcore-tools-0.4/bin:$PATH
export PATH

%files
environment.yml /

%post
/opt/conda/bin/conda env update -n root -f /environment.yml
/opt/conda/bin/conda env create -f /environment.yml
/opt/conda/bin/conda clean -a
2 changes: 1 addition & 1 deletion tests/test_lint.py
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ def test_conda_dockerfile_fail(self):
lint_obj.conda_config['name'] = 'nfcore-tools-0.4'
lint_obj.dockerfile = ['fubar']
lint_obj.check_conda_dockerfile()
expectations = {"failed": 3, "warned": 0, "passed": 0}
expectations = {"failed": 4, "warned": 0, "passed": 0}
self.assess_lint_status(lint_obj, **expectations)

def test_conda_dockerfile_skip(self):
Expand Down