Skip to content

Document how to remove a capability from the public API - #244

Open
wjohnald wants to merge 3 commits into
mainfrom
docs/removing-capabilities
Open

wjohnald wants to merge 3 commits into
mainfrom
docs/removing-capabilities

Conversation

@wjohnald

@wjohnald wjohnald commented Nov 19, 2026 •

Copy link
Copy Markdown
Contributor

GEMD Python PR

Description

This PR adds a "Removing a capability from the public API" section to CONTRIBUTING.md. Contributors get one procedure to follow when they take a field, a module, or an exported name out of the package.

The section describes two shims, each with a short code example:

  • A removed field stays on its class as a constructor argument and a property. The class discards the value, and each use emits a DeprecationWarning.
  • A removed module or exported name stays importable. The import emits a DeprecationWarning, and each use of the stand-in class raises an error.

Adding a shim takes a minor bump, and deleting it takes a major bump.

The removed_in gate checks @deprecated decorators only. Under the new section, contributors mark a shim with @deprecated where a function or method accepts the decorator. A shim that calls warn() directly gets a test, and the test fails at the removal version.

The field example matches the allowed_names shim in #242, so merge that PR first.

This PR also adds a pointer to the section in AGENTS.md.

This PR changes documentation only. It bumps the version to 3.0.4 to pass the version check.

PR Type:

  • Breaking change (fix or feature that would cause existing functionality to change)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Maintenance (non-breaking change to assist developers)

Adherence to team decisions

  • I have added tests for 100% coverage
  • I have written Numpy-style docstrings for every method and class.
  • I have communicated the downstream consequences of the PR to others.
  • I have bumped the version in __version__.py

🤖 Generated with Claude Code

wjohnald and others added 2 commits November 19, 2026 10:01
Add a CONTRIBUTING.md section on replacing a removed field, module, or
exported name with a shim that warns, and on scheduling the shim's
deletion. Point AGENTS.md at the section. Bump the version to 3.0.4.

Co-Authored-By: Claude <noreply@anthropic.com>
The field example marks the getter and setter with @deprecated, so the
removed_in gate requires the deletion. A version test remains the
advice for a shim that calls warn() directly.

Co-Authored-By: Claude <noreply@anthropic.com>
@wjohnald
wjohnald marked this pull request as ready for review November 20, 2026 16:00
@wjohnald
wjohnald requested a review from kroenlein November 20, 2026 17:21

This branch has not been deployed

No deployments
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