Skip to content

apisurface: 14 more PyPI packages, and fewer false removals - #242

Merged
adssib merged 1 commit into
mainfrom
pl4-pysurface
Nov 21, 2026
Merged

adssib merged 1 commit into
mainfrom
pl4-pysurface

Conversation

@adssib

@adssib adssib commented Nov 21, 2026 •

Copy link
Copy Markdown
Contributor

Stacked on #241.

What this changes

Fourteen new apisurface sources, one per PyPI package, each with a golden pair and a drop pair of real consecutive releases (trimmed wheels, files copied byte for byte):

source package golden pair drop pair
anthropic/python-surface pypi:anthropic 2.6.0 → 2.7.0 (beta billing-frozen error types removed) 2.4.0 → 2.5.0 (DeadlineExceededError made an alias: no event)
stripe/python-surface pypi:stripe 15.6.2 → 16.0.0 (StripeObject.request) 15.4.0 → 15.5.0
google/genai-python-surface pypi:google-genai 0.8.0 → 1.0.0 (TuningJobOrOperation) 3.3.0 → 3.4.0 (interactions re-exported from a private module: no event)
sentry/python-surface pypi:sentry-sdk 2.73.0 → 2.74.0 (utils.to_timestamp) 2.67.1 → 2.68.0 (a property setter's parameter renamed)
mongodb/pymongo-surface pypi:pymongo 4.15.5 → 4.16.0 (explicit_session gone from the command cursors) 4.15.4 → 4.15.5
redis/redis-py-surface pypi:redis 8.0.1 → 8.1.0 7.4.1 → 8.0.0
numpy/python-surface pypi:numpy 2.4.6 → 2.5.0 (row_stack, from the .pyi stubs) 2.5.0 → 2.5.1
supabase/python-surface pypi:supabase 0.7.1 → 1.0.0 (four SupabaseAuthClient parameters) 2.33.0 → 2.34.0 (supabase.client made a star re-export)
algolia/python-surface pypi:algoliasearch 4.44.1 → 4.44.3 4.44.3 → 4.44.4
elastic/python-surface pypi:elasticsearch 9.1.2 → 9.1.3 (requests_per_second now required: changed_default) 9.1.1 → 9.1.2
datadog/ddtrace-python-surface pypi:ddtrace 4.12.3 → 4.13.0 4.16.0 → 4.16.1
cloudflare/python-surface pypi:cloudflare 5.3.0 → 5.4.0 4.3.0 → 4.3.1
textual/python-surface pypi:textual 8.2.5 → 8.2.6 8.2.6 → 8.2.7
urllib3/python-surface pypi:urllib3 2.5.0 → 2.6.0 (getheader/getheaders) 2.2.1 → 2.2.2

openai/python-sdk is now openai/python-surface (no backward compatibility): anthropic/python-sdk is already Anthropic's migration-guide source, so every API-surface source is named <provider>/…-surface (numpy/python-surface, not numpy/surface: gitleaks reads "api": "numpy/surface" as a generic API key).

The reader got harder to fool (tests first, each from a false removal found by scanning the last 12 releases and every major of these packages):

  • a name its module still binds in the newer release is a note, not a removal: an alias (X = Y), an import from a private module, a star import from outside the package, a module-level __getattr__ (Release.Bindings, pysurface.ReadBindings);
  • a star import re-exports in any module, not only __init__;
  • a property's setter doesn't replace the getter, and properties' parameters aren't compared;
  • self/cls gone (a method made static) isn't a removed parameter;
  • modules under internal or vendor are private;
  • an __init__ re-exports only what it imports from its own modules (not a logger it imports from elsewhere).

Checklist

  • Metadata complete in the registration (plugins/apisurface/pypi.go), and I read the words.
  • Every commit is signed off (DCO)
  • Golden test over real saved releases (testdata/golden/<provider>-<source>.json, TestPyPIGolden)
  • testdata/README.md lists each file: URL, date fetched, license
  • One pinned drop test per source (TestPyPIDrop)
  • providers/<provider>-<source>.md for each, with Why this source and a quote from the saved release
  • Fetches only through env.Get
  • make check passes locally
  • Nothing private

Calls I made (please check)

  • ids -surface, and the openai rename (above).
  • internal/vendor modules private: ddtrace's public-looking surface was mostly ddtrace.internal.* and ddtrace.contrib.internal.*; precision over recall.
  • Cloudflare's SDK is included though some minors remove a thousand generated types (5.10.0: 1,533 events): each is a name that no longer imports. Its page says so.
  • A renamed positional parameter reads as a removed one (breaks keyword callers only); noted as a gap on every page.
  • internal/pluginlist test no longer hard-codes Algolia's exact source list (it now has an apisurface source too).
  • Golden of the existing openai source: only api (the id) changed; its fingerprints follow.

Related PRs

🤖 Generated with Claude Code

@claude

claude Bot commented Nov 21, 2026 •

Copy link
Copy Markdown

Claude finished @adssib's task in 1m 49s —— View job


✅ Ready to merge. The 14 sources are registered with complete metadata, each has a golden pair and a drop pair from real releases, and the reader changes only turn would-be removals into notes, so they can't add false events. Everything I ran passes.

Rules

Rule Status Evidence
Metadata in the registration (Rule 1) ✅ plugins/apisurface/pypi.go: each of the 15 providers registers its id, name, category and homepage. Each source registers its id, layer, watches, URLs (PyPI page and repo), pypi:<name> package and page. There's no hand-kept list. openai/python-sdk → openai/python-surface is a clean rename: no other code in the repo uses the old id. TestPyPIRegistersItself passes.
Provider pages ✅ 15 providers/*-surface.md pages, plus openai-python-sdk.md renamed to openai-python-surface.md. I read the anthropic page in full: its Why this source has the link, the date checked (2026-11-21), why the wheel is the best source, the alternatives (CHANGELOG, migration guide, no OpenAPI spec) and a dated quote from the saved release.
Golden test + quote ✅ TestPyPIGolden checks each golden file against an exact list of events in pypi_test.go. It also checks that each event cites a files.pythonhosted.org wheel and has an excerpt quoting both releases. The openai golden change (only the source id and its fingerprints) is explained in the PR body.
Drop test ✅ TestPyPIDrop runs one real consecutive pair per source, and each must produce no event.
testdata/README.md ✅ Each wheel and PyPI JSON file has a row with its URL, date fetched (2026-11-21), license and how it was trimmed.
Fetch only via env ✅ No net/http, filesystem or database use in plugin code. os/filepath appear only in pypi_test.go, which reads testdata/.
Nothing private (Rule 2) ✅ leak_guard.py --all is clean. I saw no hostnames, tokens, people or session links in the code, docs or PR body.
Contract fixtures ✅ Not touched.

Bugs

None found. I checked the precision-sensitive paths:

  • notGone + Bindings (apisurface.go:325): every new path returns a note, never an event, so it can only miss removals, not invent them.
  • Skipping self/cls (apisurface.go:282): it only applies to the first parameter.
  • Property getters, setters and deleters (pysurface.go:534-542): a property's params are now nil, and the comparison already skips symbols with nil params (apisurface.go:276). So a method turned into a property, or the reverse, can't produce a false removed_parameter.
  • numpy: the .pyi stub replaces the .py, so numpy/__init__.py's __getattr__ doesn't hide row_stack. That's correct, because numpy's __getattr__ raises on expired names.
  • __init__ re-exports (pysurface.go:299-309): now limited to the package's own modules. Both releases are read with the same rule, so the change can't produce a false difference.

Verified

  • go build ./...: ok
  • go vet ./...: ok
  • gofmt -l .: printed nothing
  • go test -race ./...: all packages pass, including plugins/apisurface (TestPyPIGolden, TestPyPIDrop, TestANameTheModuleStillBindsIsNotRemoved, TestSelfGoneIsNoRemovedParameter), pysurface and internal/pluginlist.
  • python3 scripts/leak_guard.py --all: "no banned terms (8 hashed terms checked)"
  • Not run: make check as a whole, and the separate make todos, make imports, make nethttp and make tidy targets. This environment asked for approval to run make, so please confirm CI_go is green.

Non-blocking (optional)

  • Watches text (pypi.go:35) says "removed or renamed", but the kind also emits changed_default (elasticsearch's golden has six). The provider pages already mention "parameters that lost their default"; the registered text could say the same, e.g. "…removed or renamed, and parameters removed or made required…".
  • Quotes in testdata/README.md: the new rows' Quote column says "see the source's page under providers/". The quotes are on the pages, but AGENTS.md asks for a quote in the README row itself. One short line per package (for example the class BetaBillingFrozenError(PermissionDeniedError) line) would make the README stand on its own.
  • Drop tests on trimmed wheels: each drop pair only covers the files kept in the trimmed wheel (textual's is only walk.py). That's fine for a pinned regression test, and worth knowing: "the drop pair produces no event" means "no event in these files".
  • Bindings is now stored in every snapshot. Snapshots will be larger for big generated SDKs like Cloudflare. Probably fine, but worth watching.

Thanks for the careful work, especially the scan of past releases for false removals and the tests written from each case.

Registers anthropic, stripe, google-genai, sentry-sdk, pymongo, redis,
numpy, supabase, algoliasearch, elasticsearch, ddtrace, cloudflare,
textual and urllib3, each with a golden pair and a drop pair of real
releases. openai/python-sdk is now openai/python-surface: anthropic's
python-sdk id is its migration guide's, and every API-surface source is
named <provider>/<...>-surface.

The reader now drops what scanning recent releases of these packages
showed to be no removal: a name its module still binds (an alias, an
import, a star import or __getattr__ it can't list), a property's
setter, self or cls gone, modules named internal or vendor, and an
__init__'s imports from outside its own modules. A star import re-exports
in any module.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: adssib <75389300+adssib@users.noreply.github.com>
Base automatically changed from pl4-openapi to main November 21, 2026 03:21
@adssib
adssib merged commit d6f0e7d into main Nov 21, 2026
4 checks passed
@adssib
adssib deleted the pl4-pysurface branch November 21, 2026 03:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant