build_tools/install_cexts.py
def download_package_abi3(
    path, platform, version, implementation, abi, name, pk_version, index_url, filename
):
    """
    Download the package when the abi tag is abi3. Install the package to get the dependecies
    information from METADATA in dist-info and download all the dependecies.
    """
    return_code = subprocess.call(
        [
            "python",
            "kolibripip.pex",
            "download",
            "-q",
            "-d",
            path,
            "--platform",
            platform,
            "--python-version",
            version,
            "--implementation",
            implementation,
            "--abi",
            abi,
            "-i",
            index_url,
            "--no-deps",
            "{}=={}".format(name, pk_version),
        ]
    )

    return_code = (
        subprocess.call(
            [
                "python",
                "kolibripip.pex",
                "install",
                "-q",
                "-t",
                path,
                os.path.join(path, filename),
                "--no-deps",
            ]
        )
        or return_code
    )

    os.remove(os.path.join(path, filename))

    # Open the METADATA file inside dist-info folder to find out dependencies.
    with open(
        os.path.join(path, "{}-{}.dist-info".format(name, pk_version), "METADATA"), "r"
    ) as metadata:
        for line in metadata:
            if line.startswith("Requires-Dist:"):
                requires_dist = line.rstrip("\n").split("Requires-Dist: ")
                content = requires_dist[-1].split("; ")
                version_constraint = content[0].split("(")[-1].split(")")[0]
                name = content[0].split("(")[0].strip()
                if content[-1].startswith("extra ==") or content[-1].startswith(
                    "python_version < '3'"
                ):
                    continue

                return_code = (
                    subprocess.call(
                        [
                            "python",
                            "kolibripip.pex",
                            "download",
                            "-q",
                            "-d",
                            path,
                            "--platform",
                            platform,
                            "--python-version",
                            version,
                            "--implementation",
                            implementation,
                            "--abi",
                            implementation + version + "m",
                            "-i",
                            index_url,
                            "{}{}".format(name, version_constraint),
                        ]
                    )
                    or return_code
                )

    return return_code

    Download the package when the abi tag is abi3. Install the package to get the dependecies
    information from METADATA in dist-info and download all the dependecies.
    
Download the package when the abi tag is abi3. Install the package to get the dependecies
information from METADATA in dist-info and download all the dependecies.
Download the package when the abi tag is abi3 . Install the package to get the dependecies information from METADATA in dist - info and download all the dependecies .
def download_package_abi3(
    path, platform, version, implementation, abi, name, pk_version, index_url, filename
):
    return_code = subprocess.call(
        [
            "python",
            "kolibripip.pex",
            "download",
            "-q",
            "-d",
            path,
            "--platform",
            platform,
            "--python-version",
            version,
            "--implementation",
            implementation,
            "--abi",
            abi,
            "-i",
            index_url,
            "--no-deps",
            "{}=={}".format(name, pk_version),
        ]
    )
    return_code = (
        subprocess.call(
            [
                "python",
                "kolibripip.pex",
                "install",
                "-q",
                "-t",
                path,
                os.path.join(path, filename),
                "--no-deps",
            ]
        )
        or return_code
    )
    os.remove(os.path.join(path, filename))
    with open(
        os.path.join(path, "{}-{}.dist-info".format(name, pk_version), "METADATA"), "r"
    ) as metadata:
        for line in metadata:
            if line.startswith("Requires-Dist:"):
                requires_dist = line.rstrip("\n").split("Requires-Dist: ")
                content = requires_dist[-1].split("; ")
                version_constraint = content[0].split("(")[-1].split(")")[0]
                name = content[0].split("(")[0].strip()
                if content[-1].startswith("extra ==") or content[-1].startswith(
                    "python_version < '3'"
                ):
                    continue
                return_code = (
                    subprocess.call(
                        [
                            "python",
                            "kolibripip.pex",
                            "download",
                            "-q",
                            "-d",
                            path,
                            "--platform",
                            platform,
                            "--python-version",
                            version,
                            "--implementation",
                            implementation,
                            "--abi",
                            implementation + version + "m",
                            "-i",
                            index_url,
                            "{}{}".format(name, version_constraint),
                        ]
                    )
                    or return_code
                )
    return return_code
def download_package_abi3 ( path , platform , version , implementation , abi , name , pk_version , index_url , filename ) : return_code = subprocess . call ( [ "python" , "kolibripip.pex" , "download" , "-q" , "-d" , path , "--platform" , platform , "--python-version" , version , "--implementation" , implementation , "--abi" , abi , "-i" , index_url , "--no-deps" , "{}=={}" . format ( name , pk_version ) , ] ) return_code = ( subprocess . call ( [ "python" , "kolibripip.pex" , "install" , "-q" , "-t" , path , os . path . join ( path , filename ) , "--no-deps" , ] ) or return_code ) os . remove ( os . path . join ( path , filename ) ) with open ( os . path . join ( path , "{}-{}.dist-info" . format ( name , pk_version ) , "METADATA" ) , "r" ) as metadata : for line in metadata : if line . startswith ( "Requires-Dist:" ) : requires_dist = line . rstrip ( "\n" ) . split ( "Requires-Dist: " ) content = requires_dist [ - 1 ] . split ( "; " ) version_constraint = content [ 0 ] . split ( "(" ) [ - 1 ] . split ( ")" ) [ 0 ] name = content [ 0 ] . split ( "(" ) [ 0 ] . strip ( ) if content [ - 1 ] . startswith ( "extra ==" ) or content [ - 1 ] . startswith ( "python_version < '3'" ) : continue return_code = ( subprocess . call ( [ "python" , "kolibripip.pex" , "download" , "-q" , "-d" , path , "--platform" , platform , "--python-version" , version , "--implementation" , implementation , "--abi" , implementation + version + "m" , "-i" , index_url , "{}{}" . format ( name , version_constraint ) , ] ) or return_code ) return return_code
Download the package when the abi tag is abi3.
Download the package when the abi tag is abi3 .
"""
    Download the package when the abi tag is abi3. Install the package to get the dependecies
    information from METADATA in dist-info and download all the dependecies.
    """ # Open the METADATA file inside dist-info folder to find out dependencies.
path
platform
version
implementation
abi
name
pk_version
index_url
filename