PHP 8.2.30
Preview: __init__.py Size: 967 B
//proc/thread-self/root/proc/self/root/lib/python3.8/site-packages/pip/_internal/distributions/__init__.py

from pip._internal.distributions.source.legacy import SourceDistribution
from pip._internal.distributions.wheel import WheelDistribution
from pip._internal.utils.typing import MYPY_CHECK_RUNNING

if MYPY_CHECK_RUNNING:
    from pip._internal.distributions.base import AbstractDistribution
    from pip._internal.req.req_install import InstallRequirement


def make_distribution_for_install_requirement(install_req):
    # type: (InstallRequirement) -> AbstractDistribution
    """Returns a Distribution for the given InstallRequirement
    """
    # Editable requirements will always be source distributions. They use the
    # legacy logic until we create a modern standard for them.
    if install_req.editable:
        return SourceDistribution(install_req)

    # If it's a wheel, it's a WheelDistribution
    if install_req.is_wheel:
        return WheelDistribution(install_req)

    # Otherwise, a SourceDistribution
    return SourceDistribution(install_req)

Directory Contents

Dirs: 2 × Files: 4

Name Size Perms Modified Actions
source DIR
- drwxr-xr-x 2024-03-21 10:19:28
Edit Download
- drwxr-xr-x 2024-03-21 10:19:28
Edit Download
1.08 KB lrw-r--r-- 2023-10-17 18:30:24
Edit Download
542 B lrw-r--r-- 2023-10-17 18:30:24
Edit Download
616 B lrw-r--r-- 2023-10-17 18:30:24
Edit Download
967 B lrw-r--r-- 2023-10-17 18:30:24
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).