How to use the requirementslib.Lockfile.create function in requirementslib

To help you get started, we’ve selected a few requirementslib examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github Madoshakalaka / pipenv-setup / pipenv_setup / lockfile_parser.py View on Github external
def get_dev_packages(
    lockfile_path,
):  # type: (Path) -> Tuple[Dict[str, LockConfig], Dict[str, LockConfig]]
    """
    return ONLY development packages.

    :return: a tuple of local packages and dev packages
    """
    local_packages = {}  # type: Dict[str, LockConfig]
    remote_packages = {}  # type: Dict[str, LockConfig]
    for package_name, config in (
        Lockfile.create(str(lockfile_path.parent)).get_deps(dev=True).items()
    ):
        if is_remote_package(config):
            remote_packages[package_name] = config
        else:
            local_packages[package_name] = config
    return local_packages, remote_packages
github Madoshakalaka / pipenv-setup / pipenv_setup / lockfile_parser.py View on Github external
def get_default_packages(
    lockfile_path,
):  # type: (Path) -> Tuple[Dict[str, LockConfig], Dict[str, LockConfig]]
    """
    return local packages and remote packages in default packages (not dev)
    """
    local_packages = {}  # type: Dict[str, LockConfig]
    remote_packages = {}  # type: Dict[str, LockConfig]
    for package_name, config in (
        Lockfile.create(lockfile_path.parent).get_deps().items()
    ):
        if is_remote_package(config):
            remote_packages[package_name] = config
        else:
            local_packages[package_name] = config
    return local_packages, remote_packages