release: prepare python-mlb-statsapi 0.9.0 - #281
Merged
Conversation
* test: establish 0.9 HTTP behavior contract Co-authored-by: Matthew Spah <spahmatthew@gmail.com> * test: drop unused f-string in HTTP contract URL Co-authored-by: Matthew Spah <spahmatthew@gmail.com> * test: add brief docstrings to HTTP contract tests Co-authored-by: Matthew Spah <spahmatthew@gmail.com> * test: drop future MlbHttpError attribute guards Co-authored-by: Matthew Spah <spahmatthew@gmail.com> --------- Co-authored-by: Cursor Agent <cursoragent@cursor.com>
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Relax the MlbHttpError compatibility contract
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Expose the default retry policy
Add richer context to MlbHttpError
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Add optional strict HTTP mode
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Bump the project version to 0.9.0 and add scripts/validate_release.py, a focused validator for the built wheel and source distribution. The validator checks artifact presence, wheel metadata (name, version, Requires-Python), required sdist contents, and then installs the wheel into a temporary virtual environment and runs a public-import smoke test from outside the repository so the checkout cannot shadow the installed package. It never contacts the MLB API. Offline CI now watches release/0.9.0 alongside main and runs the validator after poetry build instead of only confirming that artifacts exist. Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Update the README HTTP section for 0.9.0: compatibility mode as the default, opt-in strict mode, MlbHttpCompatibilityWarning and selective filtering, the public create_retry_policy() helper on a caller-managed Session, the richer MlbHttpError attributes, the versioned User-Agent, Session ownership, and Session cleanup. Adds links to the transport document and release notes. Audit docs/http-transport.md against the implementation: drop stale 0.8.0 'current release' references, list the public transport API, promote Session ownership to its own section, complete the compatibility/strict behavior table with the successful and warning cases, spell out exactly when a warning is and is not emitted, and describe the 1.0 migration direction without committing to an implementation. Add docs/releases/0.9.0.md and offline tests that keep the documented examples compilable, free of private attributes, and consistent with the declared version. Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Document and prepare release 0.9.0
Mattsface
marked this pull request as ready for review
August 5, 2026 05:36
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Refs #265
Refs #272
Summary
Version 0.9.0 is the configurable HTTP behavior release.
This release builds on the HTTP reliability work from 0.8.0 by exposing the retry policy as a supported public API, adding richer HTTP error context, introducing an optional strict mode, warning when compatibility mode suppresses a client error, and identifying library-created Sessions with a versioned User-Agent.
The release branch is currently 20 commits ahead of
mainand 0 commits behind.Highlights
Public retry policy
create_retry_policy()is now part of the package-root public API.Callers who own their own
requests.Sessioncan explicitly mount the same tested retry policy used by library-created Sessions without the library silently changing their adapters.The retry values remain unchanged from 0.8.0:
Retry-AfterrespectedRicher
MlbHttpErrorcontextMlbHttpErrorpreserves its existing public fields and adds:methodresponse_databody_excerptJSON dictionaries and lists are captured when available, while text context is limited to a bounded 500-character excerpt. Context extraction is best-effort and cannot replace the original HTTP error.
Optional strict HTTP mode
Applications can opt into stricter behavior:
In strict mode:
MlbHttpErrorMlbHttpErrorCompatibility mode remains the default for 0.9.0.
Compatibility warnings and the path toward 1.0
When compatibility mode converts a final non-404 4xx response into the historical empty result, the library now emits
MlbHttpCompatibilityWarning.The warning inherits from
FutureWarning, includes migration guidance forstrict_http=True, and can be filtered independently from unrelated warnings.This release does not make strict mode the default. A future 1.0 release may make final non-404 4xx responses raise by default, which would be a breaking change. Version 0.9.0 provides the opt-in mode and warning period needed to find affected call sites before that decision is finalized.
Versioned User-Agent
Sessions created by the library now send:
For this release, the installed wheel resolves that to:
The value comes from installed package metadata rather than a duplicated source constant. Caller-injected Session headers remain untouched.
Session ownership remains explicit
The library does not silently reconfigure or close a Session supplied by the caller.
Documentation and release validation
This release expands the README and detailed HTTP transport documentation, adds 0.9.0 release notes, updates CI for the current release branch, and adds a focused release validator.
The validator checks:
The installed-wheel smoke test runs outside the repository checkout so local source files cannot shadow the installed package.
Compatibility
Version 0.9.0 preserves:
Mlbclientstrict_httpadded as a keyword-only optionNone,[], and{}TheMlbStatsApiExceptionOne intentional visible difference is that compatibility mode is no longer silent for final non-404 4xx responses. Applications or test suites that treat warnings as errors may need to handle or selectively filter
MlbHttpCompatibilityWarning, or opt intostrict_http=True.Validation completed on the release branch
poetry check— passed, with pre-existing Poetry deprecation notices onlygit diff --check— cleanThe final pull-request CI must still pass against
mainbefore this PR is marked ready.Review focus
Please pay particular attention to:
Before marking ready
mainpython -m twine check dist/*main...release/0.9.0diff one final timeMerge and publishing plan
After review and validation:
v0.9.0.twine checkagainst those artifacts.python-mlb-statsapi==0.9.0from public PyPI with cache disabled and run the public smoke checks.Do not tag or publish as part of reviewing this PR.