Skip to content

Commit 23ae047

Browse files
committed
freshen cwltool/software_requirements.py
1 parent 9f9867a commit 23ae047

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

cwltool/software_requirements.py

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,10 @@
1212
import string
1313
from typing import Dict, List, MutableMapping, MutableSequence, Optional, Union, cast
1414

15-
from .builder import Builder, HasReqsHints
15+
from typing_extensions import TYPE_CHECKING
16+
17+
if TYPE_CHECKING:
18+
from .builder import Builder, HasReqsHints
1619

1720
try:
1821
from galaxy.tool_util.deps.requirements import ToolRequirement, ToolRequirements
@@ -34,8 +37,7 @@
3437

3538

3639
class DependenciesConfiguration(object):
37-
def __init__(self, args):
38-
# type: (argparse.Namespace) -> None
40+
def __init__(self, args: argparse.Namespace) -> None:
3941
"""Initialize."""
4042
conf_file = getattr(args, "beta_dependency_resolvers_configuration", None)
4143
tool_dependency_dir = getattr(args, "beta_dependencies_directory", None)
@@ -55,8 +57,7 @@ def __init__(self, args):
5557
else:
5658
self.use_tool_dependencies = False
5759

58-
def build_job_script(self, builder, command):
59-
# type: (Builder, List[str]) -> str
60+
def build_job_script(self, builder: "Builder", command: List[str]) -> str:
6061
ensure_galaxy_lib_available()
6162
resolution_config_dict = {
6263
"use": self.use_tool_dependencies,
@@ -87,7 +88,7 @@ def build_job_script(self, builder, command):
8788
return job_script
8889

8990

90-
def get_dependencies(builder: HasReqsHints) -> ToolRequirements:
91+
def get_dependencies(builder: "HasReqsHints") -> ToolRequirements:
9192
(software_requirement, _) = builder.get_requirement("SoftwareRequirement")
9293
dependencies = [] # type: List[ToolRequirement]
9394
if software_requirement and software_requirement.get("packages"):
@@ -117,8 +118,9 @@ def get_dependencies(builder: HasReqsHints) -> ToolRequirements:
117118
return ToolRequirements.from_list(dependencies)
118119

119120

120-
def get_container_from_software_requirements(use_biocontainers, builder):
121-
# type: (bool, HasReqsHints) -> Optional[str]
121+
def get_container_from_software_requirements(
122+
use_biocontainers: bool, builder: "HasReqsHints"
123+
) -> Optional[str]:
122124
if use_biocontainers:
123125
ensure_galaxy_lib_available()
124126
from galaxy.tool_util.deps.dependencies import AppInfo, ToolInfo
@@ -144,8 +146,7 @@ def get_container_from_software_requirements(use_biocontainers, builder):
144146
return None
145147

146148

147-
def ensure_galaxy_lib_available():
148-
# type: () -> None
149+
def ensure_galaxy_lib_available() -> None:
149150
if not SOFTWARE_REQUIREMENTS_ENABLED:
150151
raise Exception(
151152
"Optional Python library galaxy-lib not available, it is required for this configuration."

0 commit comments

Comments
 (0)