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

Method parse

src/packagedcode/pypi.py:1417–1445  ·  view source on GitHub ↗
(cls, location, package_only=False)

Source from the content-addressed store, hash-verified

1415
1416 @classmethod
1417 def parse(cls, location, package_only=False):
1418 # FIXME: add dependencies
1419
1420 try:
1421 sdist = pkginfo2.SDist(location)
1422 except ValueError:
1423 return
1424
1425 name = sdist.name
1426 version = sdist.version
1427 urls, extra_data = get_urls(metainfo=sdist, name=name, version=version)
1428 extracted_license_statement, license_file = get_declared_license(metainfo=sdist)
1429 if license_file:
1430 extra_data['license_file'] = license_file
1431
1432 package_data = dict(
1433 datasource_id=cls.datasource_id,
1434 type=cls.default_package_type,
1435 primary_language=cls.default_primary_language,
1436 name=name,
1437 version=version,
1438 description=get_description(sdist, location=location),
1439 extracted_license_statement=extracted_license_statement,
1440 keywords=get_keywords(sdist),
1441 parties=get_parties(sdist),
1442 extra_data=extra_data,
1443 **urls,
1444 )
1445 yield models.PackageData.from_data(package_data, package_only)
1446
1447
1448class PythonSetupPyHandler(BaseExtractedPythonLayout):

Callers

nothing calls this directly

Calls 6

get_declared_licenseFunction · 0.85
get_descriptionFunction · 0.85
get_keywordsFunction · 0.85
from_dataMethod · 0.80
get_urlsFunction · 0.70
get_partiesFunction · 0.70

Tested by

no test coverage detected