From 44f8967c494f219f588305a2a23023d4b5a170e8 Mon Sep 17 00:00:00 2001 From: Mike Lin Date: Tue, 21 Apr 2020 16:33:04 -1000 Subject: [PATCH] nuke pylint no-member --- Makefile | 6 ++++-- WDL/Tree.py | 1 - WDL/runtime/task.py | 6 ++---- WDL/runtime/workflow.py | 18 +++++------------- 4 files changed, 11 insertions(+), 20 deletions(-) diff --git a/Makefile b/Makefile index 42851752..349aeac3 100644 --- a/Makefile +++ b/Makefile @@ -37,7 +37,8 @@ check: --search-path stubs \ --typeshed `python3 -c 'import site; print(site.getuserbase())'`/lib/pyre_check/typeshed \ --show-parse-errors check - pylint -j `python3 -c 'import multiprocessing as mp; print(mp.cpu_count())'` --errors-only WDL + # no-member disabled due to https://github.com/PyCQA/pylint/issues/3137 + pylint -j `python3 -c 'import multiprocessing as mp; print(mp.cpu_count())'` --errors-only WDL -d no-member check_check: # regression test against pyre doing nothing (issue #100) @@ -48,7 +49,8 @@ check_check: # uses black to rewrite source files! pretty: black --line-length 100 --target-version py36 WDL/ - pylint -d cyclic-import,empty-docstring,missing-docstring,invalid-name,bad-continuation --exit-zero WDL + # no-member disabled due to https://github.com/PyCQA/pylint/issues/3137 + pylint -d cyclic-import,empty-docstring,missing-docstring,invalid-name,bad-continuation --exit-zero WDL -d no-member # for use in CI: complain if source code isn't at a fixed point for black sopretty: diff --git a/WDL/Tree.py b/WDL/Tree.py index 8cd6214f..28c9c536 100644 --- a/WDL/Tree.py +++ b/WDL/Tree.py @@ -1231,7 +1231,6 @@ def children(self) -> Iterable[SourceNode]: if imp.doc: yield imp.doc for stb in self.struct_typedefs: - # pylint: disable=no-member assert isinstance(stb, Env.Binding) and isinstance(stb.value, StructTypeDef) yield stb.value for task in self.tasks: diff --git a/WDL/runtime/task.py b/WDL/runtime/task.py index 300561fd..e0a6588a 100644 --- a/WDL/runtime/task.py +++ b/WDL/runtime/task.py @@ -777,7 +777,7 @@ def run_local_task( # provision run directory and log file run_dir = provision_run_dir(task.name, run_dir, last_link=not _run_id_stack) logfile = os.path.join(run_dir, "task.log") - fh = cleanup.enter_context(LoggingFileHandler(logger, logfile)) # pylint: disable=no-member + fh = cleanup.enter_context(LoggingFileHandler(logger, logfile)) fh.setFormatter(logging.Formatter(LOGGING_FORMAT)) logger.notice( # pyre-fixme _( @@ -793,9 +793,7 @@ def run_local_task( write_values_json(inputs, os.path.join(run_dir, "inputs.json")) if not _run_id_stack: - cache = _cache or cleanup.enter_context( # pylint: disable=no-member - CallCache(cfg, logger) - ) + cache = _cache or cleanup.enter_context(CallCache(cfg, logger)) cache.flock(logfile, exclusive=True) # no containing workflow; flock task.log else: cache = _cache diff --git a/WDL/runtime/workflow.py b/WDL/runtime/workflow.py index 53cec92a..961c9b93 100644 --- a/WDL/runtime/workflow.py +++ b/WDL/runtime/workflow.py @@ -623,7 +623,7 @@ def run_local_workflow( logger = logging.getLogger(".".join(logger_id)) logfile = os.path.join(run_dir, "workflow.log") with ExitStack() as cleanup: - fh = cleanup.enter_context(LoggingFileHandler(logger, logfile)) # pylint: disable=no-member + fh = cleanup.enter_context(LoggingFileHandler(logger, logfile)) fh.setFormatter(logging.Formatter(LOGGING_FORMAT)) logger.notice( # pyre-fixme _( @@ -638,9 +638,7 @@ def run_local_workflow( logger.debug(_("thread", ident=threading.get_ident())) write_values_json(inputs, os.path.join(run_dir, "inputs.json"), namespace=workflow.name) - terminating = cleanup.enter_context( # pylint: disable=no-member - TerminationSignalFlag(logger) - ) + terminating = cleanup.enter_context(TerminationSignalFlag(logger)) # if we're the top-level workflow, provision CallCache and thread pools if not _run_id_stack: @@ -651,9 +649,7 @@ def run_local_workflow( logger.notice(_("miniwdl", version=version)) # pyre-fixme assert not _thread_pools - cache = _cache or cleanup.enter_context( # pylint: disable=no-member - CallCache(cfg, logger) - ) + cache = _cache or cleanup.enter_context(CallCache(cfg, logger)) cache.flock(logfile, exclusive=True) # flock top-level workflow.log # Provision separate thread pools for tasks and sub-workflows. With just one pool, it'd @@ -665,13 +661,9 @@ def run_local_workflow( cfg["scheduler"].get_int("call_concurrency") or multiprocessing.cpu_count() ) task_pool = futures.ThreadPoolExecutor(max_workers=max_workers) - cleanup.callback( # pylint: disable=no-member - futures.ThreadPoolExecutor.shutdown, task_pool - ) + cleanup.callback(futures.ThreadPoolExecutor.shutdown, task_pool) subwf_pool = futures.ThreadPoolExecutor(max_workers=max_workers) - cleanup.callback( # pylint: disable=no-member - futures.ThreadPoolExecutor.shutdown, subwf_pool - ) + cleanup.callback(futures.ThreadPoolExecutor.shutdown, subwf_pool) thread_pools = (task_pool, subwf_pool) else: assert _thread_pools and _cache