From 00888f6c3e6dd8f6def05a9b46e2088f50238a98 Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 31 May 2018 13:54:15 +0200 Subject: Pass --limited-api=yes when building with py3 on Coin This is needed to generate correct wheel names, that can be uploaded to PyPI. Change-Id: If97496d201af13f58f9dae8b61ac86bef68d8717 Reviewed-by: Friedemann Kleint Reviewed-by: Cristian Maureira-Fredes --- coin_build_instructions.py | 2 ++ 1 file changed, 2 insertions(+) (limited to 'coin_build_instructions.py') diff --git a/coin_build_instructions.py b/coin_build_instructions.py index ad4331845..1a6e3dae3 100644 --- a/coin_build_instructions.py +++ b/coin_build_instructions.py @@ -85,6 +85,8 @@ def call_setup(python_ver): "--jobs=4", "--verbose-build", "--snapshot-build"] + if python_ver == "3": + cmd += ["--limited-api=yes"] run_instruction(cmd, "Failed to run setup.py") -- cgit v1.2.3 From f71e58336b34940782d9742a1b9b4e413f525f0a Mon Sep 17 00:00:00 2001 From: Alexandru Croitor Date: Thu, 31 May 2018 14:11:13 +0200 Subject: Don't set --snapshot-build for official release builds on Coin This changes coin_build_instructions.py to read the version in sources/pyside2/pyside_version.py to check if it is not a pre-release version (no alphas, betas), which means that --snapshot-build should not be passed, thus generating proper wheel names that can be uploaded to PyPI. This eliminates the need to remove the --snapshot-build param on a per release branch basis (and thus, less things to remember for official releases). Change-Id: I10afcb5bfe8a661583104f3d7b2c0b4ebd4530fb Reviewed-by: Friedemann Kleint --- coin_build_instructions.py | 36 ++++++++++++++++++++++++++++++++++-- 1 file changed, 34 insertions(+), 2 deletions(-) (limited to 'coin_build_instructions.py') diff --git a/coin_build_instructions.py b/coin_build_instructions.py index 1a6e3dae3..c48f5e3b2 100644 --- a/coin_build_instructions.py +++ b/coin_build_instructions.py @@ -42,6 +42,7 @@ from build_scripts.utils import install_pip_dependencies from build_scripts.utils import get_qtci_virtualEnv from build_scripts.utils import run_instruction from build_scripts.utils import rmtree +from build_scripts.utils import get_python_dict import os # Values must match COIN thrift @@ -60,6 +61,36 @@ if _ci_features is not None: CI_FEATURES.append(f) CI_RELEASE_CONF = has_option("packaging") +def get_current_script_path(): + """ Returns the absolute path containing this script. """ + try: + this_file = __file__ + except NameError: + this_file = sys.argv[0] + this_file = os.path.abspath(this_file) + return os.path.dirname(this_file) + +def is_snapshot_build(): + """ + Returns True if project needs to be built with --snapshot-build + + This is true if the version found in pyside_version.py is not a + pre-release version (no alphas, betas). + + This eliminates the need to remove the --snapshot-build option + on a per-release branch basis (less things to remember to do + for a release). + """ + setup_script_dir = get_current_script_path() + pyside_version_py = os.path.join( + setup_script_dir, "sources", "pyside2", "pyside_version.py") + d = get_python_dict(pyside_version_py) + + pre_release_version_type = d['pre_release_version_type'] + pre_release_version = d['pre_release_version'] + if pre_release_version or pre_release_version_type: + return True + return False def call_setup(python_ver): _pExe, _env, env_pip, env_python = get_qtci_virtualEnv(python_ver, CI_HOST_OS, CI_HOST_ARCH, CI_TARGET_ARCH) @@ -83,10 +114,11 @@ def call_setup(python_ver): cmd += ["--qmake=" + CI_ENV_INSTALL_DIR + "/bin/qmake"] cmd += ["--build-tests", "--jobs=4", - "--verbose-build", - "--snapshot-build"] + "--verbose-build"] if python_ver == "3": cmd += ["--limited-api=yes"] + if is_snapshot_build(): + cmd += ["--snapshot-build"] run_instruction(cmd, "Failed to run setup.py") -- cgit v1.2.3 From 6383820c4b32395fe6dfead79f38ff93b7a0e686 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Simo=20F=C3=A4lt?= Date: Thu, 31 May 2018 15:12:43 +0300 Subject: Enable msvc 2017 wheels instead of msvc 2015 Change-Id: I4c81b9131e37b8ed91fa02756ed19df25fd2dd8e Reviewed-by: Alexandru Croitor --- coin_build_instructions.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'coin_build_instructions.py') diff --git a/coin_build_instructions.py b/coin_build_instructions.py index ad4331845..4608c890c 100644 --- a/coin_build_instructions.py +++ b/coin_build_instructions.py @@ -69,7 +69,7 @@ def call_setup(python_ver): cmd = [env_python, "setup.py"] # With 5.11 CI will create two sets of release binaries, one with msvc 2015 and one with msvc 2017 # we shouldn't release the 2015 version. - if CI_RELEASE_CONF and CI_COMPILER not in ["MSVC2017"]: + if CI_RELEASE_CONF and CI_COMPILER not in ["MSVC2015"]: cmd += ["bdist_wheel", "--standalone"] else: cmd += ["build"] -- cgit v1.2.3