[Python-modules-commits] [python-docutils] 07/14: run 2to3 in parallel
Dmitry Shachnev
mitya57 at moszumanska.debian.org
Sat Dec 10 10:40:51 UTC 2016
This is an automated email from the git hooks/post-receive script.
mitya57 pushed a commit to branch master
in repository python-docutils.
commit 71f36957f858eefd3d1fa158397e794dc608365e
Author: Jakub Wilk <jwilk at debian.org>
Date: Thu Oct 8 11:57:07 2015 -0700
run 2to3 in parallel
Forwarded: not-needed
Last-Update: 2012-05-12
Patch-Name: parallel-2to3.diff
---
setup.py | 12 ++++++++++++
1 file changed, 12 insertions(+)
diff --git a/setup.py b/setup.py
index 97ec659..118bec1 100755
--- a/setup.py
+++ b/setup.py
@@ -24,6 +24,18 @@ except ImportError:
if sys.version_info >= (3,):
+
+ num_processes = 1
+ for option in os.environ.get('DEB_BUILD_OPTIONS', '').split():
+ if option.startswith('parallel='):
+ num_processes = int(option.split('=', 1)[1])
+ if num_processes > 1:
+ import lib2to3.refactor
+ class RefactoringTool(lib2to3.refactor.MultiprocessRefactoringTool):
+ def refactor(self, items, write=False):
+ return lib2to3.refactor.MultiprocessRefactoringTool.refactor(self, items, write=write, num_processes=num_processes)
+ lib2to3.refactor.RefactoringTool = RefactoringTool
+
# copy-convert auxiliary python sources
class copy_build_py_2to3(build_py_2to3):
"""Copy/convert Python source files in given directories recursively.
--
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/python-modules/packages/python-docutils.git
More information about the Python-modules-commits
mailing list