MCPcopy Create free account
hub / github.com/SourceCode-AI/aura / analyzer_poetry_lock

Function analyzer_poetry_lock

aura/analyzers/pyproject.py:30–56  ·  view source on GitHub ↗
(*, location: ScanLocation)

Source from the content-addressed store, hash-verified

28
29
30def analyzer_poetry_lock(*, location: ScanLocation):
31 lock = parse_toml(location.location.read_text())
32
33 for pkg in lock["package"]:
34 pkg_version = Version(pkg["version"])
35 pkg_name = str(pkg["name"])
36
37 try:
38 pypi = package.PypiPackage.from_cached(pkg_name)
39 latest = Version(pypi.get_latest_release())
40
41 if latest > pkg_version:
42 yield Detection(
43 detection_type="OutdatedPackage",
44 message=f"Package {pkg_name}=={pkg_version} in poetry.lock is outdated, newest version is {latest}",
45 signature=f"outpdate_pkg#{str(location)}#{pkg_name}#{pkg_version}",
46 score=get_score_or_default("requirement-outdated", 5),
47 location=location.location,
48 extra={
49 "package": pkg_name,
50 "specs": f"=={pkg_version}",
51 "latest": str(latest)
52 },
53 tags={"outdated_package"}
54 )
55 except NoSuchPackage:
56 pass

Callers 1

analyze_pyprojectFunction · 0.85

Calls 4

DetectionClass · 0.85
get_score_or_defaultFunction · 0.85
from_cachedMethod · 0.80
get_latest_releaseMethod · 0.80

Tested by

no test coverage detected