Skip to content

ci: publish PyPI download badges from a reliable endpoint - #252

Open
omaiesh wants to merge 2 commits into
mainfrom
ci/download-badges
Open

ci: publish PyPI download badges from a reliable endpoint#252
omaiesh wants to merge 2 commits into
mainfrom
ci/download-badges

Conversation

@omaiesh

@omaiesh omaiesh commented Aug 11, 2026

Copy link
Copy Markdown
Collaborator

The README's download badges break regularly. shields.io's pypi/dm badge reads pypistats.org's /recent endpoint, which is aggressively rate limited; when it refuses, shields renders "rate limited by upstream service" and GitHub's camo proxy caches that error image, so the badge stays broken long after the upstream recovers. Measured on 20cfc30: the camo-cached image for rosetta-mcp showed the rate-limit text while a direct fetch returned 594/month.

Read pypistats' /overall series instead, which answers reliably, sum the last 30 days excluding mirrors, and publish a shields endpoint JSON to an orphan badges branch. Counts match what shields reports when it does work: rosetta-mcp 594, rosetta-cli 540.

Mirrors stay excluded deliberately. Including them roughly quadruples the number (2442 and 2008) without a single extra install, which is why pepy.tech reports "2k" for both packages.

Runs daily, on demand, and on changes to its own files. No secrets needed.

omaiesh and others added 2 commits August 11, 2026 23:28
The README's download badges break regularly. shields.io's pypi/dm badge
reads pypistats.org's /recent endpoint, which is aggressively rate limited;
when it refuses, shields renders "rate limited by upstream service" and
GitHub's camo proxy caches that error image, so the badge stays broken long
after the upstream recovers. Measured on 20cfc30: the camo-cached image for
rosetta-mcp showed the rate-limit text while a direct fetch returned
594/month.

Read pypistats' /overall series instead, which answers reliably, sum the
last 30 days excluding mirrors, and publish a shields endpoint JSON to an
orphan `badges` branch. Counts match what shields reports when it does
work: rosetta-mcp 594, rosetta-cli 540.

Mirrors stay excluded deliberately. Including them roughly quadruples the
number (2442 and 2008) without a single extra install, which is why
pepy.tech reports "2k" for both packages.

Runs daily, on demand, and on changes to its own files. No secrets needed.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
git switch --orphan already starts with an empty tree, unlike
git checkout --orphan, so the git rm only emitted a fatal pathspec
error into the job log. Caught by simulating the step against a local
bare repository.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
@omaiesh
omaiesh requested a review from isolomatov-gd August 12, 2026 12:45
@isolomatov-gd

Copy link
Copy Markdown
Contributor

I think we should restructure those badges completely:

  1. Bring NPM ones
  2. Bring unique cloners
  3. Bring stats on usage of rosetta

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants