Skip to content

Commit

Permalink
nuke pylint no-member
Browse files Browse the repository at this point in the history
  • Loading branch information
mlin committed Apr 22, 2020
1 parent 35cf2ac commit 44f8967
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 20 deletions.
6 changes: 4 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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:
Expand Down
1 change: 0 additions & 1 deletion WDL/Tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
6 changes: 2 additions & 4 deletions WDL/runtime/task.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
_(
Expand All @@ -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
Expand Down
18 changes: 5 additions & 13 deletions WDL/runtime/workflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -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
_(
Expand All @@ -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:
Expand All @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 44f8967

Please sign in to comment.