(self, other: PypiPackage)
| 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_")) |
no outgoing calls
no test coverage detected