feat: add "Multiple on PyPI" badge for SDK monorepos

azure-sdk-for-python and google-cloud-python were rendering "Not on
PyPI", which is misleading. Both do ship on PyPI, just as many
per-service packages (azure-identity, azure-storage-blob,
google-cloud-storage, etc.) rather than under the repo name.

pypi_name_overrides.json already recorded that distinction in its
reason field; those two entries now carry an optional "badge" value
that build.py reads into the PyPI Downloads column. The other sixteen
no-count entries (cpython, renpy, agent skill repos, etc.) keep
"Not on PyPI" since that remains accurate for them.

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
Vinta Chen
2026-08-23 01:28:33 +08:00
co-authored by Claude
parent c07324b24f
commit 0f677911f0
6 changed files with 40 additions and 9 deletions
+12
View File
@@ -18,6 +18,7 @@ from build import (
extract_entries,
extract_github_repo,
load_downloads,
load_pypi_badges,
load_stars,
sort_entries,
subcategory_path,
@@ -1012,6 +1013,16 @@ class TestLoadStars:
# ---------------------------------------------------------------------------
class TestLoadPypiBadges:
def test_only_entries_with_a_badge_are_returned(self):
badges = load_pypi_badges()
assert badges["azure-sdk-for-python"] == "Multiple on PyPI"
assert badges["google-cloud-python"] == "Multiple on PyPI"
# Entries whose missing count needs no explaining stay off the map
assert "cpython" not in badges
assert "tomllib" not in badges
def _template_entry(name: str, stars: int | None, source_type: str | None = None) -> TemplateEntry:
return TemplateEntry(
name=name,
@@ -1026,6 +1037,7 @@ def _template_entry(name: str, stars: int | None, source_type: str | None = None
last_commit_at=None,
source_type=source_type,
bundled=False,
badge=None,
also_see=[],
)