Release/1.0.0 - #296
Merged
Merged
Conversation
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
…ault feat: make strict HTTP behavior the default (#284)
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
feat: preserve explicit HTTP compatibility mode (#285)
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
docs: add the 1.0 migration guide (#287)
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
…ract docs: define the stable 1.0 public API
Python 3.14 formats typing.Union[a, b] as "a | b" while Python 3.10-3.13 format "Union[a, b]", so the get_persons signature manifest entry failed only on 3.14. The annotation object is unchanged; normalize the legacy rendering so one manifest stays valid on every supported interpreter. Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
The release validator only clean-installed the wheel and only proved the strict HTTP default through constructor signatures, so a broken source distribution or a behavioral regression in strict handling could pass. Offline CI also still watched the stale release/0.9.0 branch and tested only Python 3.10-3.12. Validator: - clean-install the wheel and the source distribution in separate throwaway virtual environments and run the same smoke test against both - generalize wheel-only terminology to cover both distribution artifacts - verify a final fake 403 raises MlbHttpError under the default and under explicit strict_http=True, for Mlb and for MlbDataAdapter on v1 and v1.1 - verify strict_http=False returns the historical empty result and emits exactly one MlbHttpCompatibilityWarning mentioning strict_http=False - assert MlbHttpError status_code, reason, method, url, and response_data without freezing the exception or warning strings - verify an injected requests.Session keeps its headers and its exact adapter objects, never receives the library retry policy, and is never closed by the library - verify a library-created Session carries the installed-metadata User-Agent and the documented retry policy - label reverted strict defaults explicitly instead of raising a bare AssertionError - name the failing artifact, field, or path with expected and actual values in every validation error - expand the required source-distribution paths to the files the archive intentionally carries Tests: - unit-cover the validator helpers with synthetic wheel ZIPs and sdist tarballs, including every required failure mode - prove validate() clean-installs both artifacts in separate environments - lock the documentation Python-example checks to every release-notes file while keeping current-version checks off historical notes - require the release/1.0.0 CI trigger literally instead of deriving it from the still-unbumped package version - cover the Python matrix, twine check, and publishing-safety contract CI and docs: - watch main and release/1.0.0; drop release/0.9.0 - test Python 3.10 through 3.14 and build on 3.14 - add twine as a development dependency and run twine check on both artifacts; nothing is uploaded - state the 3.10 minimum and 3.10-3.14 CI coverage in the current docs The package version stays 0.9.0; the 1.0.0 bump belongs to a separate issue and the validator keeps reading the expected version from pyproject.toml. Co-authored-by: Matthew Spah <spahmatthew@gmail.com>
…tion build: harden 1.0 release validation
Update the invalid game ID test to expect MlbHttpError for the live API's 400 response instead of treating it as a 404 result. Also close the shared Mlb client during test cleanup.
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.
release: prepare python-mlb-statsapi 1.0.0
Refs #289
Why
Version 1.0.0 establishes the stable public API contract for the 1.x series and changes the default HTTP behavior.
In 0.9.x, non-404 4xx responses could be handled through the historical compatibility path by default. In 1.0.0, strict HTTP behavior is now the default, so final non-404 4xx responses raise
MlbHttpError.This release also needed the documentation, release validation, supported Python matrix, and built artifacts to reflect the final 1.0 contract before anything is tagged or published.
What
This PR prepares the
release/1.0.0branch for final release intomain.Main changes include:
0.9.0to1.0.0MlbandMlbDataAdapterstrict_http=Falsepython-mlb-statsapi/1.0.0twine checkagainst both distribution artifacts400 Bad Requestresponse for an invalid game ID under the new strict HTTP defaultNo tag, PyPI upload, or GitHub release is created by this PR.
Tests
Deterministic tests were run with:
GitHub Actions also passes the offline suite on:
The package build and release validation pass with:
poetry check rm -rf dist poetry build python3 scripts/validate_release.py poetry run twine check dist/* git diff --checkThe release validator clean-installs and smoke-tests both:
It also verifies:
Mlb()uses strict HTTP behavior by defaultMlb(strict_http=True)remains supportedMlb(strict_http=False)preserves compatibility behaviorMlbHttpCompatibilityWarningremains publicThe live MLB API suite was also run. One outdated Home Run Derby test expected an invalid game ID to behave like a 404, but the live MLB API currently returns
400 Bad Request. The test was updated to expectMlbHttpErrorfor that response, which matches the documented 1.0 strict HTTP contract.Risk and impact
Risk level: Normal
This is a major-version release and intentionally changes the default handling of non-404 4xx responses, so applications that relied on the historical empty-result behavior may need to update their exception handling.
The risk is reduced by:
strict_http=Falseavailable as an explicit migration pathIf something does go wrong, the most likely impact is an application receiving
MlbHttpErrorwhere it previously relied on a suppressed non-404 4xx response.The compatibility opt-out provides a temporary migration path:
This PR itself does not publish anything. Tagging
v1.0.0, uploading to PyPI, performing the public PyPI smoke test, and creating the GitHub release will happen only after this PR is merged and the final release sequence is explicitly approved.