aboutsummaryrefslogtreecommitdiffstats
path: root/coin_build_instructions.py
diff options
context:
space:
mode:
authorFriedemann Kleint <Friedemann.Kleint@qt.io>2018-06-01 13:23:44 +0200
committerFriedemann Kleint <Friedemann.Kleint@qt.io>2018-06-01 13:23:48 +0200
commite4e72eae189e57c255193aa8ee556a3d9936d110 (patch)
tree56c79d8d75479d71d341f5682531fdbd11f6ec95 /coin_build_instructions.py
parent6383820c4b32395fe6dfead79f38ff93b7a0e686 (diff)
parentae0aa898a3bc1701499ff7993c8d31bc86eb1675 (diff)
Merge remote-tracking branch 'origin/5.9' into 5.11
Diffstat (limited to 'coin_build_instructions.py')
-rw-r--r--coin_build_instructions.py38
1 files changed, 36 insertions, 2 deletions
diff --git a/coin_build_instructions.py b/coin_build_instructions.py
index 4608c890c..91a900518 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,8 +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")