Exemple #1
0
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, ["six", "wheel"])
    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"]:
        cmd += ["bdist_wheel", "--standalone"]
    else:
        cmd += ["build"]
    if CI_HOST_OS == "MacOS":
        cmd += ["--qmake=" + CI_ENV_INSTALL_DIR + "/bin/qmake"]
    elif CI_HOST_OS == "Windows":

        cmd += ["--qmake=" + CI_ENV_INSTALL_DIR + "\\bin\\qmake.exe",
                "--openssl=C:\\openssl\\bin"]
    else:
        cmd += ["--qmake=" + CI_ENV_INSTALL_DIR + "/bin/qmake"]
    cmd += ["--build-tests",
            "--jobs=4",
            "--verbose-build",
            "--snapshot-build"]

    run_instruction(cmd, "Failed to run setup.py")
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):
    _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, ["six", "wheel"])
    cmd = [env_python, "setup.py"]
    if CI_RELEASE_CONF:
        cmd += ["bdist_wheel", "--standalone"]
    else:
        cmd += ["build"]
    if CI_HOST_OS == "MacOS":
        cmd += ["--qmake=" + CI_ENV_INSTALL_DIR + "/bin/qmake"]
    elif CI_HOST_OS == "Windows":

        cmd += ["--qmake=" + CI_ENV_INSTALL_DIR + "\\bin\\qmake.exe"]
    else:
        cmd += ["--qmake=" + CI_ENV_INSTALL_DIR + "/bin/qmake"]
    cmd += ["--build-tests", "--jobs=4", "--verbose-build"]
    if python_ver == "3":
        cmd += ["--limited-api=yes"]
    if is_snapshot_build():
        cmd += ["--snapshot-build"]

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

    run_instruction(cmd, "Failed to run setup.py")
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)
Exemple #5
0
def clean_egg_info():
    # After a successful bdist_wheel build, some .egg-info directories
    # are left over, which confuse pip when invoking it via
    # python -m pip, making pip think that the packages are already
    # installed in the root source directory.
    # Clean up the .egg-info directories to fix this, it should be
    # safe to do so.
    paths = find_files_using_glob(setup_script_dir, "*.egg-info")
    for p in paths:
        log.info("Removing {}".format(p))
        rmtree(p)
Exemple #6
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)
    run_instruction(["virtualenv", "-p", _pExe, _env],
                    "Failed to create virtualenv")
    install_pip_dependencies(env_pip, ["six", "wheel"])
    cmd = [
        env_python, "testrunner.py", "test", "--blacklist",
        "build_history/blacklist.txt", "--buildno=" + buildnro
    ]
    run_instruction(cmd, "Failed to run testrunner.py")
Exemple #7
0
def prepare_build_folder(src_path, build_folder_name):
    build_path = os.path.join(src_path, build_folder_name)

    # The script can be called for both Python 2 and Python 3 wheels, so
    # preparing a build folder should clean any previous existing build.
    if os.path.exists(build_path):
        log.info("Removing {}".format(build_path))
        rmtree(build_path)

    log.info("Creating {}".format(build_path))
    os.makedirs(build_path)
    os.chdir(build_path)
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")
Exemple #10
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")