diff options
| author | Giampaolo Rodola <g.rodola@gmail.com> | 2020-04-29 19:23:08 -0700 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-04-30 04:23:08 +0200 |
| commit | 997bc0d92935b8033e28b79d8dd0595ba4462960 (patch) | |
| tree | 95a7a25b6f0c0d08d625f96162959bb05320aadb /scripts | |
| parent | 93c1138ca81b8bf5edd250fc470e1a5770dbdcdd (diff) | |
| download | psutil-997bc0d92935b8033e28b79d8dd0595ba4462960.tar.gz | |
Parallel build (#1741)
Diffstat (limited to 'scripts')
| -rwxr-xr-x | scripts/internal/winmake.py | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/scripts/internal/winmake.py b/scripts/internal/winmake.py index c9aa2952..f39d45ac 100755 --- a/scripts/internal/winmake.py +++ b/scripts/internal/winmake.py @@ -227,8 +227,13 @@ def build(): # edit mode). sh('%s -c "import setuptools"' % PYTHON) + # "build_ext -i" copies compiled *.pyd files in ./psutil directory in + # order to allow "import psutil" when using the interactive interpreter + # from within psutil root directory. + cmd = [PYTHON, "setup.py", "build_ext", "-i"] + if sys.version_info[:2] >= (3, 6) and os.cpu_count() or 1 > 1: + cmd += ['--parallel', str(os.cpu_count())] # Print coloured warnings in real time. - cmd = [PYTHON, "setup.py", "build"] p = subprocess.Popen(cmd, stdout=subprocess.PIPE, stderr=subprocess.STDOUT) try: for line in iter(p.stdout.readline, b''): @@ -250,10 +255,6 @@ def build(): p.terminate() p.wait() - # Copies compiled *.pyd files in ./psutil directory in order to - # allow "import psutil" when using the interactive interpreter - # from within this directory. - sh("%s setup.py build_ext -i" % PYTHON) # Make sure it actually worked. sh('%s -c "import psutil"' % PYTHON) win_colorprint("build + import successful", GREEN) |
