コード例 #1
0
def discover_prebuilt_whl(whl_directory, setuppy_path):
    wheels = []
    pkg_name, _, version = get_package_details(setuppy_path)
    whl_name = find_whl(whl_directory, pkg_name, version)
    if whl_name is None:
        logging.error("whl is missing in prebuilt whl directory {0} for package {1} and version {2}".format(whl_directory, pkg_name, version))
        exit(1)
    wheels.append(whl_name)
    return wheels
コード例 #2
0
def get_package_wheel_path(pkg_root):
    # parse setup.py to get package name and version
    pkg_name, _, version = get_package_details(os.path.join(pkg_root, "setup.py"))
    # Check if wheel is already built and available for current package
    prebuilt_dir = os.getenv("PREBUILT_WHEEL_DIR")
    if prebuilt_dir:
        prebuilt_package_path = find_whl(prebuilt_dir, pkg_name, version)
    else:
        return None
コード例 #3
0
def discover_prebuilt_package(dist_directory, setuppy_path, package_type):
    packages = []
    pkg_name, _, version = get_package_details(setuppy_path)
    if package_type == "wheel":
        prebuilt_package = find_whl(dist_directory, pkg_name, version)
    else:
        prebuilt_package = find_sdist(dist_directory, pkg_name, version)

    if prebuilt_package is None:
        logging.error("Package is missing in prebuilt directory {0} for package {1} and version {2}".format(dist_directory, pkg_name, version))
        exit(1)
    packages.append(prebuilt_package)
    return packages