[diffoscope] 01/02: {config, main}: adds check_parallel on init
Juliana Oliveira
jwnx-guest at moszumanska.debian.org
Fri Mar 9 07:02:07 CET 2018
This is an automated email from the git hooks/post-receive script.
jwnx-guest pushed a commit to branch jwnx_parallel_diffoscope
in repository diffoscope.
commit 613d4f9576a10477c7f59cd2a94ea0090c0f1b57
Author: Juliana Oliveira <juliana.orod at gmail.com>
Date: Mon Mar 5 19:19:47 2018 -0300
{config, main}: adds check_parallel on init
Checks if dill and multiprocess are importable. If they aren't,
Config().parallel flag will be set to false.
Signed-off-by: Juliana Oliveira <juliana.orod at gmail.com>
---
diffoscope/config.py | 6 ++++++
diffoscope/main.py | 1 +
2 files changed, 7 insertions(+)
diff --git a/diffoscope/config.py b/diffoscope/config.py
index ff07695..9b57a04 100644
--- a/diffoscope/config.py
+++ b/diffoscope/config.py
@@ -89,3 +89,9 @@ class Config(object):
self.check_ge("max_diff_block_lines", "max_page_diff_block_lines")
self.check_ge("max_report_size", "max_page_size")
self.check_ge("max_report_size", "max_page_size_child")
+
+ def check_parallel(self):
+ from importlib import util
+ multiprocess = util.find_spec("multiprocess")
+ dill = util.find_spec("dill")
+ self.parallel = (multiprocess and dill)
diff --git a/diffoscope/main.py b/diffoscope/main.py
index 1424119..66acb68 100644
--- a/diffoscope/main.py
+++ b/diffoscope/main.py
@@ -371,6 +371,7 @@ def run_diffoscope(parsed_args):
Config().exclude_commands = parsed_args.exclude_commands
Config().exclude_directory_metadata = parsed_args.exclude_directory_metadata
Config().compute_visual_diffs = PresenterManager().compute_visual_diffs()
+ Config().check_parallel()
Config().check_constraints()
tool_prepend_prefix(parsed_args.tool_prefix_binutils, *"ar as ld ld.bfd nm objcopy objdump ranlib readelf strip".split())
set_path()
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/reproducible/diffoscope.git
More information about the diffoscope
mailing list