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

Function check_outdated

aura/analyzers/requirements_analyzer.py:73–91  ·  view source on GitHub ↗
(requirement: Requirement, location: ScanLocation)

Source from the content-addressed store, hash-verified

71
72
73def check_outdated(requirement: Requirement, location: ScanLocation) -> Optional[Detection]:
74 pypi = package.PypiPackage.from_cached(requirement.name)
75 latest = pypi.get_latest_release()
76 spec_set = requirement.specifier
77
78 if latest not in spec_set:
79 return Detection(
80 detection_type="OutdatedPackage",
81 message=f"Package {requirement.name}{str(spec_set)} is outdated, newest version is {latest}",
82 signature=f"req_outdated#{str(location)}#{requirement.name}#{str(spec_set)}#{latest}",
83 score=get_score_or_default("requirement-outdated", 5),
84 location=location.location,
85 extra={
86 "package": requirement.name,
87 "specs": str(spec_set),
88 "latest": latest
89 },
90 tags={"outdated_package"}
91 )
92
93
94@Analyzer.ID("requirements_file_analyzer")

Callers 1

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