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

Method _cmp_info

aura/package.py:236–259  ·  view source on GitHub ↗
(self, other: PypiPackage)

Source from the content-addressed store, hash-verified

234 yield (self_archive, other_archive)
235
236 def _cmp_info(self, other: PypiPackage) -> table.Table:
237 info_table = table.Table(metadata={"title": "PyPI metadata diff"})
238
239 sum1 = self["info"]["summary"] or ""
240 sum2 = other["info"]["summary"] or ""
241 sum_sim = difflib.SequenceMatcher(lambda x: x in " \t\n", sum1, sum2).ratio()
242 info_table += ("Description Similarity", sum_sim)
243
244 is_similar_desc = (sum_sim >= 0.8)
245 info_table += ("Similar Description", is_similar_desc)
246
247 page1 = self["info"]["home_page"] or ""
248 page2 = other["info"]["home_page"] or ""
249 info_table += ("Same homepage", (page1 == page2))
250
251 docs1 = self["info"]["docs_url"] or ""
252 docs2 = other["info"]["docs_url"] or ""
253 info_table += ("Same documentation URL", (docs1 == docs2))
254
255 releases1 = set(self["releases"].keys())
256 releases2 = set(other["releases"].keys())
257 info_table += ("Has Subreleases", releases1.issuperset(releases2))
258
259 return info_table
260
261 def _cmp_archives(self, other: PypiPackage) -> Generator[Tuple[ScanLocation, ScanLocation], None, None]:
262 temp_dir = Path(tempfile.mkdtemp(prefix="aura_pkg_diff_"))

Callers 2

output_typosquattingMethod · 0.80
get_diff_pathsMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected