MCPcopy Create free account
hub / github.com/aboutcode-org/scancode-toolkit / get_dependencies

Function get_dependencies

src/packagedcode/conan.py:281–300  ·  view source on GitHub ↗
(requires)

Source from the content-addressed store, hash-verified

279
280
281def get_dependencies(requires):
282 dependent_packages = []
283 for req in requires:
284 name, constraint = req.split("/", 1)
285 is_pinned = is_constraint_pinned(constraint)
286 version = None
287 if is_pinned:
288 version = constraint
289 purl = PackageURL(type="conan", name=name, version=version)
290 dependent_packages.append(
291 models.DependentPackage(
292 purl=purl.to_string(),
293 scope="install",
294 is_runtime=True,
295 is_optional=False,
296 is_pinned=is_pinned,
297 extracted_requirement=constraint,
298 )
299 )
300 return dependent_packages

Callers 1

_parseMethod · 0.70

Calls 4

is_constraint_pinnedFunction · 0.85
to_stringMethod · 0.80
splitMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected