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

Function find_problems

etc/scripts/utils_thirdparty.py:2252–2281  ·  view source on GitHub ↗

Print the problems found in `dest_dir`.

(
    dest_dir=THIRDPARTY_DIR,
    report_missing_sources=False,
    report_missing_wheels=False,
)

Source from the content-addressed store, hash-verified

2250
2251
2252def find_problems(
2253 dest_dir=THIRDPARTY_DIR,
2254 report_missing_sources=False,
2255 report_missing_wheels=False,
2256):
2257 """
2258 Print the problems found in `dest_dir`.
2259 """
2260
2261 local_packages = get_local_packages(directory=dest_dir)
2262
2263 for package in local_packages:
2264 if report_missing_sources and not package.sdist:
2265 print(f"{package.name}=={package.version}: Missing source distribution.")
2266 if report_missing_wheels and not package.wheels:
2267 print(f"{package.name}=={package.version}: Missing wheels.")
2268
2269 for dist in package.get_distributions():
2270 dist.load_about_data(dest_dir=dest_dir)
2271 abpth = os.path.abspath(os.path.join(dest_dir, dist.about_filename))
2272 if not dist.has_key_metadata():
2273 print(f" Missing key ABOUT data in file://{abpth}")
2274 if "classifiers" in dist.extra_data:
2275 print(f" Dangling classifiers data in file://{abpth}")
2276 if not dist.validate_checksums(dest_dir):
2277 print(f" Invalid checksums in file://{abpth}")
2278 if not dist.sha1 and dist.md5:
2279 print(f" Missing checksums in file://{abpth}")
2280
2281 check_about(dest_dir=dest_dir)
2282
2283
2284def get_license_expression(declared_licenses):

Callers

nothing calls this directly

Calls 7

get_local_packagesFunction · 0.85
check_aboutFunction · 0.85
get_distributionsMethod · 0.80
load_about_dataMethod · 0.80
has_key_metadataMethod · 0.80
validate_checksumsMethod · 0.80
joinMethod · 0.45

Tested by

no test coverage detected