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)
    rmtree(_env, True)
    run_instruction(["virtualenv", "-p", _pExe,  _env], "Failed to create virtualenv")

    install_pip_dependencies(env_pip, ["pip", "numpy", "setuptools", "sphinx", "six", "wheel"])

    cmd = [env_python, "-u", "setup.py"]
    if CI_RELEASE_CONF:
        cmd += ["bdist_wheel", "--standalone"]
    else:
        cmd += ["build"]
    qmake_path = get_ci_qmake_path(CI_ENV_INSTALL_DIR, CI_HOST_OS)
    cmd.append(qmake_path)
    cmd += ["--build-tests",
            "--parallel=4",
            "--verbose-build"]
    if python_ver == "3":
        cmd += ["--limited-api=yes"]
    if is_snapshot_build():
        cmd += ["--snapshot-build"]

    # Due to certain older CMake versions generating very long paths
    # (at least with CMake 3.6.2) when using the export() function,
    # pass the shorter paths option on Windows so we don't hit
    # the path character length limit (260).
    if CI_HOST_OS == "Windows":
        cmd += ["--shorter-paths"]

    cmd += ["--package-timestamp=" + CI_INTEGRATION_ID]

    env = os.environ
    run_instruction(cmd, "Failed to run setup.py", initial_env=env)
def call_setup(python_ver, phase):
    print("call_setup")
    print("python_ver", python_ver)
    print("phase", phase)
    _pExe, _env, env_pip, env_python = get_qtci_virtualEnv(python_ver, CI_HOST_OS, CI_HOST_ARCH, CI_TARGET_ARCH)

    if phase in ["BUILD"]:
        rmtree(_env, True)
        # Pinning the virtualenv before creating one
        run_instruction(["pip", "install", "--user", "virtualenv==20.0.25"], "Failed to pin virtualenv")
        # installing to user base might not be in PATH by default.
        env_path = os.path.join(site.USER_BASE, "bin")
        v_env = os.path.join(env_path, "virtualenv")
        if sys.platform == "win32":
            env_path = os.path.join(site.USER_BASE, "Scripts")
            v_env = os.path.join(env_path, "virtualenv.exe")
        try:
            run_instruction([v_env, "--version"], "Using default virtualenv")
        except Exception as e:
            v_env = "virtualenv"
        run_instruction([v_env, "-p", _pExe,  _env], "Failed to create virtualenv")
        # When the 'python_ver' variable is empty, we are using Python 2
        # Pip is always upgraded when CI template is provisioned, upgrading it in later phase may cause perm issue
        run_instruction([env_pip, "install", "-r", "requirements.txt"], "Failed to install dependencies")
        if sys.platform == "win32":
            run_instruction([env_pip, "install", "numpy==1.19.3"], "Failed to install numpy 1.19.3")
        else:
            run_instruction([env_pip, "install", "numpy"], "Failed to install numpy")

    cmd = [env_python, "-u", "setup.py"]
    if phase in ["BUILD"]:
        cmd += ["build", "--standalone", "--skip-packaging"]
    elif phase in ["WHEEL"] or CI_RELEASE_CONF:
        cmd += ["bdist_wheel", "--reuse-build", "--standalone", "--skip-cmake", "--skip-make-install", "--only-package"]

    cmd += ["--build-tests",
            "--parallel=4",
            "--verbose-build"]
    if python_ver == "3":
        cmd += ["--limited-api=yes"]
    if is_snapshot_build():
        cmd += ["--snapshot-build"]

    qmake_path = get_ci_qmake_path(CI_ENV_INSTALL_DIR, CI_HOST_OS)
    cmd.append(qmake_path)

    # Due to certain older CMake versions generating very long paths
    # (at least with CMake 3.6.2) when using the export() function,
    # pass the shorter paths option on Windows so we don't hit
    # the path character length limit (260).
    if CI_HOST_OS == "Windows":
        cmd += ["--shorter-paths"]

    cmd += ["--package-timestamp=" + CI_INTEGRATION_ID]

    env = os.environ
    run_instruction(cmd, "Failed to run setup.py for build", initial_env=env)
def call_testrunner(python_ver, buildnro):
    _pExe, _env, env_pip, env_python = get_qtci_virtualEnv(python_ver, CI_HOST_OS, CI_HOST_ARCH, CI_TARGET_ARCH)
    rmtree(_env, True)
    run_instruction(["virtualenv", "-p", _pExe,  _env], "Failed to create virtualenv")
    install_pip_dependencies(env_pip, ["numpy", "PyOpenGL", "setuptools", "six", "pyinstaller"])
    install_pip_wheel_package(env_pip)
    cmd = [env_python, "testrunner.py", "test",
                  "--blacklist", "build_history/blacklist.txt",
                  "--buildno=" + buildnro]
    run_instruction(cmd, "Failed to run testrunner.py")

    qmake_path = get_ci_qmake_path(CI_ENV_INSTALL_DIR, CI_HOST_OS)

    # Try to install built wheels, and build some buildable examples (except macOS/Python 2.16)
    if CI_RELEASE_CONF and CI_HOST_OS != 'MacOS' or sys.version_info[0] == 3:
        wheel_tester_path = os.path.join("testing", "wheel_tester.py")
        cmd = [env_python, wheel_tester_path, qmake_path]
        run_instruction(cmd, "Error while running wheel_tester.py")
def call_testrunner(python_ver, buildnro):
    _pExe, _env, env_pip, env_python = get_qtci_virtualEnv(python_ver, CI_HOST_OS, CI_HOST_ARCH, CI_TARGET_ARCH)
    rmtree(_env, True)
    run_instruction(["virtualenv", "-p", _pExe,  _env], "Failed to create virtualenv")
    # Keeping PyInstaller 3.4, because 3.5 seems to have broken our test
    install_pip_dependencies(env_pip, ["pip", "numpy", "PyOpenGL", "setuptools", "six", "pyinstaller==3.4", "wheel"])
    cmd = [env_python, "testrunner.py", "test",
                  "--blacklist", "build_history/blacklist.txt",
                  "--buildno=" + buildnro]
    run_instruction(cmd, "Failed to run testrunner.py")

    qmake_path = get_ci_qmake_path(CI_ENV_INSTALL_DIR, CI_HOST_OS)

    # Try to install built wheels, and build some buildable examples.
    if CI_RELEASE_CONF:
        wheel_tester_path = os.path.join("testing", "wheel_tester.py")
        cmd = [env_python, wheel_tester_path, qmake_path]
        run_instruction(cmd, "Error while running wheel_tester.py")
Esempio n. 5
0
def call_testrunner(python_ver, buildnro):
    _pExe, _env, env_pip, env_python = get_qtci_virtualEnv(
        python_ver, CI_HOST_OS, CI_HOST_ARCH, CI_TARGET_ARCH)
    rmtree(_env, True)
    # Pinning the virtualenv before creating one
    run_instruction(["pip", "install", "--user", "virtualenv==20.0.25"],
                    "Failed to pin virtualenv")
    # installing to user base might not be in PATH by default.
    env_path = os.path.join(site.USER_BASE, "bin")
    v_env = os.path.join(env_path, "virtualenv")
    if sys.platform == "win32":
        env_path = os.path.join(site.USER_BASE, "Scripts")
        v_env = os.path.join(env_path, "virtualenv.exe")
    try:
        run_instruction([v_env, "--version"], "Using default virtualenv")
    except Exception as e:
        v_env = "virtualenv"

    run_instruction([v_env, "-p", _pExe, _env], "Failed to create virtualenv")
    # When the 'python_ver' variable is empty, we are using Python 2
    # Pip is always upgraded when CI template is provisioned, upgrading it in later phase may cause perm issue
    run_instruction([env_pip, "install", "-r", "requirements.txt"],
                    "Failed to install dependencies")
    if sys.platform == "win32":
        run_instruction([env_pip, "install", "numpy==1.19.3"],
                        "Failed to install numpy 1.19.3")
    else:
        run_instruction([env_pip, "install", "numpy"],
                        "Failed to install numpy")

    cmd = [
        env_python, "testrunner.py", "test", "--blacklist",
        "build_history/blacklist.txt", "--buildno=" + buildnro
    ]
    run_instruction(cmd, "Failed to run testrunner.py")

    qmake_path = get_ci_qmake_path(CI_ENV_INSTALL_DIR, CI_HOST_OS)

    # Try to install built wheels, and build some buildable examples.
    if CI_RELEASE_CONF:
        wheel_tester_path = os.path.join("testing", "wheel_tester.py")
        cmd = [env_python, wheel_tester_path, qmake_path]
        run_instruction(cmd, "Error while running wheel_tester.py")