build_tools/install_cexts.py
def install_package_by_wheel(path):
    """
    Install the package using the downloaded wheel files.
    """
    files = os.listdir(path)
    for file in files:
        # When the abi tag is abi3, the package has been installed, and a dist-info
        # folder has been generated. Skip the installed package and remove the
        # dist-info folder.
        if os.path.isdir(os.path.join(path, file)):
            if file.endswith(".dist-info"):
                shutil.rmtree(os.path.join(path, file))
            continue

        # If the file is py2, py3 compatible, install it into kolibri/dist/cext
        # instead of specific platform paths to reduce the size of installer
        if "py2.py3-none-any" in file:
            return_code = subprocess.call(
                [
                    "python",
                    "kolibripip.pex",
                    "install",
                    "-q",
                    "-U",
                    "-t",
                    DIST_CEXT,
                    os.path.join(path, file),
                    "--no-deps",
                ]
            )
        else:
            return_code = subprocess.call(
                [
                    "python",
                    "kolibripip.pex",
                    "install",
                    "-q",
                    "-t",
                    path,
                    os.path.join(path, file),
                    "--no-deps",
                ]
            )

        if return_code == 1:
            sys.exit("\nInstallation failed for package {}.\n".format(file))
        else:
            # Clean up the whl file and dist-info folder
            os.remove(os.path.join(path, file))
            shutil.rmtree(
                os.path.join(path, "-".join(file.split("-", 2)[:2]) + ".dist-info"),
                ignore_errors=True,
            )

    Install the package using the downloaded wheel files.
    
Install the package using the downloaded wheel files.
Install the package using the downloaded wheel files .
def install_package_by_wheel(path):
    files = os.listdir(path)
    for file in files:
        if os.path.isdir(os.path.join(path, file)):
            if file.endswith(".dist-info"):
                shutil.rmtree(os.path.join(path, file))
            continue
        if "py2.py3-none-any" in file:
            return_code = subprocess.call(
                [
                    "python",
                    "kolibripip.pex",
                    "install",
                    "-q",
                    "-U",
                    "-t",
                    DIST_CEXT,
                    os.path.join(path, file),
                    "--no-deps",
                ]
            )
        else:
            return_code = subprocess.call(
                [
                    "python",
                    "kolibripip.pex",
                    "install",
                    "-q",
                    "-t",
                    path,
                    os.path.join(path, file),
                    "--no-deps",
                ]
            )
        if return_code == 1:
            sys.exit("\nInstallation failed for package {}.\n".format(file))
        else:
            os.remove(os.path.join(path, file))
            shutil.rmtree(
                os.path.join(path, "-".join(file.split("-", 2)[:2]) + ".dist-info"),
                ignore_errors=True,
            )
def install_package_by_wheel ( path ) : files = os . listdir ( path ) for file in files : if os . path . isdir ( os . path . join ( path , file ) ) : if file . endswith ( ".dist-info" ) : shutil . rmtree ( os . path . join ( path , file ) ) continue if "py2.py3-none-any" in file : return_code = subprocess . call ( [ "python" , "kolibripip.pex" , "install" , "-q" , "-U" , "-t" , DIST_CEXT , os . path . join ( path , file ) , "--no-deps" , ] ) else : return_code = subprocess . call ( [ "python" , "kolibripip.pex" , "install" , "-q" , "-t" , path , os . path . join ( path , file ) , "--no-deps" , ] ) if return_code == 1 : sys . exit ( "\nInstallation failed for package {}.\n" . format ( file ) ) else : os . remove ( os . path . join ( path , file ) ) shutil . rmtree ( os . path . join ( path , "-" . join ( file . split ( "-" , 2 ) [ : 2 ] ) + ".dist-info" ) , ignore_errors = True , )
Install the package using the downloaded wheel files.
Install the package using the downloaded wheel files .
"""
    Install the package using the downloaded wheel files.
    """ # When the abi tag is abi3, the package has been installed, and a dist-info # folder has been generated. Skip the installed package and remove the # dist-info folder. # If the file is py2, py3 compatible, install it into kolibri/dist/cext # instead of specific platform paths to reduce the size of installer # Clean up the whl file and dist-info folder
path