Skip to content

Commit

Permalink
wip
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin committed Mar 15, 2024
1 parent 642b979 commit 0f4c3d3
Show file tree
Hide file tree
Showing 5 changed files with 18 additions and 10 deletions.
8 changes: 5 additions & 3 deletions WDL/CLI.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def __call__(self, parser, namespace, values, option_string=None):
# importlib_metadata doesn't seem to provide EntryPoint.dist to get from an entry point to
# the metadata of the package providing it; continuing to use pkg_resources for this. Risk
# that they give inconsistent results?
import pkg_resources
import pkg_resources # type: ignore

for group in runtime.config.default_plugins().keys():
group = f"miniwdl.plugin.{group}"
Expand Down Expand Up @@ -1116,7 +1116,8 @@ def runner_input_json_file(available_inputs, namespace, input_file, downloadable
if input_file:
input_file = input_file.strip()
if input_file:
import yaml # delayed heavy import
# delayed heavy import:
import yaml # type: ignore

input_json = None
if input_file[0] == "{":
Expand Down Expand Up @@ -1745,7 +1746,7 @@ def configure(cfg=None, show=False, force=False, **kwargs):
die("`miniwdl configure` is for interactive use")

from datetime import datetime
import bullet
import bullet # type: ignore
from xdg import XDG_CONFIG_HOME

miniwdl_version = pkg_version()
Expand Down Expand Up @@ -2148,6 +2149,7 @@ def _type_to_input_template(ty: Type.Base):
"""
if isinstance(ty, Type.StructInstance):
ans = {}
assert ty.members
for member_name, member_type in ty.members.items():
if not member_type.optional: # TODO: opt in to these
ans[member_name] = _type_to_input_template(member_type)
Expand Down
2 changes: 1 addition & 1 deletion WDL/runtime/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,4 @@ def run(
if "max_tasks" in run_kwargs and isinstance(exe, Tree.Task):
del run_kwargs["max_tasks"] # N/A to run_local_task
entrypoint = run_local_task if isinstance(exe, Tree.Task) else run_local_workflow
return entrypoint(cfg, exe, inputs, **run_kwargs) # pyre-ignore
return entrypoint(cfg, exe, inputs, **run_kwargs) # type: ignore
4 changes: 2 additions & 2 deletions WDL/runtime/backend/cli_subprocess.py
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,8 @@ def _run(self, logger: logging.Logger, terminating: Callable[[], bool], command:
poll_cli_log()
if terminating():
raise Terminated()
assert isinstance(exit_code, int)
return exit_code
assert isinstance(exit_code, int)
return exit_code

@abstractproperty
def cli_name(self) -> str:
Expand Down
8 changes: 4 additions & 4 deletions WDL/runtime/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -1142,15 +1142,15 @@ def scan_uri(v: Union[Value.File, Value.Directory]) -> str:
Value.rewrite_env_paths(inputs, scan_uri)
if not uris:
return
logger.notice(_("downloading input URIs", count=len(uris))) # pyre-fixme
logger.notice(_("downloading input URIs", count=len(uris)))

# download them on the thread pool (but possibly further limiting concurrency)
download_concurrency = cfg.get_int("scheduler", "download_concurrency")
if download_concurrency <= 0:
download_concurrency = 999999
ops = {}
ops: Dict[futures.Future[Tuple[bool, str]], str] = {}
incomplete = len(uris)
outstanding = set()
outstanding: Set[futures.Future[Tuple[bool, str]]] = set()
downloaded_bytes = 0
cached_hits = 0
exn = None
Expand Down Expand Up @@ -1208,7 +1208,7 @@ def scan_uri(v: Union[Value.File, Value.Directory]) -> str:

if exn:
raise exn
logger.notice( # pyre-fixme
logger.notice(
_(
"processed input URIs",
cached=cached_hits,
Expand Down
6 changes: 6 additions & 0 deletions stubs/logging/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from logging import Logger as OriginalLogger
from logging import DEBUG, INFO, WARNING, ERROR, CRITICAL

class Logger(OriginalLogger):
def notice(self, *args, **kwargs) -> None: ...
def verbose(self, *args, **kwargs) -> None: ...

0 comments on commit 0f4c3d3

Please sign in to comment.