Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
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