Skip to content

Commit

Permalink
adjust to pass mypy, linters
Browse files Browse the repository at this point in the history
  • Loading branch information
Brandon Walker committed Nov 20, 2023
1 parent 7e72856 commit e61ac63
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions cwltool/singularity.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
import sys
from subprocess import check_call, check_output # nosec
from typing import Callable, Dict, List, MutableMapping, Optional, Tuple, cast
from spython.main.parse.parsers import DockerParser
from spython.main.parse.writers import get_writer
from spython.main import Client
from spython.main.parse.parsers import DockerParser # type: ignore
from spython.main.parse.writers import get_writer # type: ignore
from spython.main import Client # type: ignore
from schema_salad.sourceline import SourceLine

from .builder import Builder
Expand Down Expand Up @@ -133,7 +133,7 @@ def __init__(
def get_image(
dockerRequirement: Dict[str, str],
pull_image: bool,
tmp_outdir_prefix,
tmp_outdir_prefix: str,
force_pull: bool = False,
) -> bool:
"""
Expand Down Expand Up @@ -178,14 +178,14 @@ def get_image(
dfile.write(dockerRequirement["dockerFile"])

Check warning on line 178 in cwltool/singularity.py

View check run for this annotation

Codecov / codecov/patch

cwltool/singularity.py#L178

Added line #L178 was not covered by tests

parser = DockerParser(dockerfile_path)
SingularityWriter = get_writer('singularity')
SingularityWriter = get_writer("singularity")
writer = SingularityWriter(parser.recipe)
result = writer.convert()

Check warning on line 183 in cwltool/singularity.py

View check run for this annotation

Codecov / codecov/patch

cwltool/singularity.py#L180-L183

Added lines #L180 - L183 were not covered by tests
with open(singularityfile_path, 'w') as file:
with open(singularityfile_path, "w") as file:
file.write(result)

Check warning on line 185 in cwltool/singularity.py

View check run for this annotation

Codecov / codecov/patch

cwltool/singularity.py#L185

Added line #L185 was not covered by tests
os.environ['APPTAINER_TMPDIR'] = absolute_path
Client.build(recipe=singularityfile_path, build_folder=absolute_path, sudo = False)

os.environ["APPTAINER_TMPDIR"] = absolute_path
Client.build(recipe=singularityfile_path, build_folder=absolute_path, sudo=False)
found = True

Check warning on line 189 in cwltool/singularity.py

View check run for this annotation

Codecov / codecov/patch

cwltool/singularity.py#L187-L189

Added lines #L187 - L189 were not covered by tests
if "dockerImageId" not in dockerRequirement and "dockerPull" in dockerRequirement:
match = re.search(pattern=r"([a-z]*://)", string=dockerRequirement["dockerPull"])
Expand Down

0 comments on commit e61ac63

Please sign in to comment.