diff --git a/appveyor.yml b/appveyor.yml index 692e5d9b166..1c34f5b5437 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -109,7 +109,7 @@ build_script: b2.exe --hash openssl-lib=%ssl_lib% openssl-include=%ssl_include% warnings=all -j %NUMBER_OF_PROCESSORS% %compiler% address-model=%model% picker-debugging=on invariant-checks=full variant=%variant% link=shared crypto=%crypto% asserts=on export-extra=on windows-api=%api% windows-version=win10 libtorrent-link=shared stage_module stage_dependencies ) - if defined python_dist ( - c:\Python35-x64\python.exe setup.py bdist --format=msi + c:\Python36-x64\python.exe setup.py bdist --format=msi ) # simulations diff --git a/bindings/python/setup.py b/bindings/python/setup.py old mode 100644 new mode 100755 index be2d3731c95..07504488f93 --- a/bindings/python/setup.py +++ b/bindings/python/setup.py @@ -7,6 +7,7 @@ import sys import sysconfig import tempfile +import multiprocessing import setuptools import setuptools.command.build_ext as _build_ext_lib @@ -14,7 +15,7 @@ def get_msvc_toolset(): # Reference: https://wiki.python.org/moin/WindowsCompilers - major_minor = sys.version_info()[0:2] + major_minor = sys.version_info[0:2] if major_minor in ((2, 6), (2, 7), (3, 0), (3, 1), (3, 2)): return "msvc-9.0" if major_minor in ((3, 3), (3, 4)): @@ -96,7 +97,8 @@ def write_b2_python_config(config): # python.jam appends SHLIB_SUFFIX on its own. ext_suffix = sysconfig.get_config_var("EXT_SUFFIX") shlib_suffix = sysconfig.get_config_var("SHLIB_SUFFIX") - ext_suffix = ext_suffix[: -len(shlib_suffix)] + if shlib_suffix != None and len(shlib_suffix) < len(ext_suffix): + ext_suffix = ext_suffix[: -len(shlib_suffix)] write(f' : "{ext_suffix}"') write(" ;\n") @@ -193,7 +195,9 @@ def build_extension_with_b2(self): self.announce("project-config.jam contents:") self.announce(config.read()) config.close() + args.append(f"python={sysconfig.get_python_version()}") args.append(f"--project-config={config.name}") + args.append(f"-j{multiprocessing.cpu_count()}") self.spawn(["b2"] + args) finally: os.unlink(config.name)