chore!: require Python >=3.10; remove deprecated NWIS_Metadata.variable_info (1.2.0)#332
Draft
thodson-usgs wants to merge 1 commit into
Draft
chore!: require Python >=3.10; remove deprecated NWIS_Metadata.variable_info (1.2.0)#332thodson-usgs wants to merge 1 commit into
thodson-usgs wants to merge 1 commit into
Conversation
…le_info Ahead of the breaking 1.2.0 release. Require Python >=3.10 - 3.9 support was already effectively broken: `waterdata`'s `anyio` dependency and the test stack (`pytest-httpx`) require 3.10+, and the `waterdata` test modules already skip on <3.10 — so the CI 3.9 leg was a hollow shell. - `requires-python = ">=3.10"`; ruff `target-version = "py310"`; mypy `python_version = "3.10"`. Bumping mypy to 3.10 also lets it parse `anyio`'s 3.10 source (the `mypy<2` pin existed only to keep targeting 3.9, now dropped). - Declare `anyio>=4.0` as a direct dependency — it's imported directly by `waterdata` (`start_blocking_portal`), previously relied on transitively via httpx. - CI test matrix `["3.9", "3.13", "3.14"]` -> `["3.10", "3.13", "3.14"]`. - Fill in the Trove classifiers (per-version 3.10-3.14, dev-status, audience, topic). - The py310 ruff target enables `B905`; add explicit `strict=False` to the four pre-existing `zip()` calls (`nwis`, `waterdata/chunking`, `waterdata/nearest`) — identical to the prior implicit behavior. Remove deprecated `NWIS_Metadata.variable_info` - It only emitted a `DeprecationWarning` and returned `None` (it relied on the defunct `get_pmcodes`). Accessing it now raises `NotImplementedError` via the `utils.BaseMetadata` abstract contract. Drops the obsolete unit test. BREAKING CHANGE: Python 3.9 is no longer supported; `pip install dataretrieval>=1.2.0` requires Python >=3.10. `NWIS_Metadata.variable_info` is removed (it always returned None). Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sjb14HkwuCydKSKMsaXsgd
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.
Two breaking changes for the 1.2.0 release.
1. Require Python >=3.10
3.9 support was already effectively broken — the manifest just claimed otherwise:
waterdata'sanyiodependency and the test stack (pytest-httpx) require 3.10+, and thewaterdatatest modules already skip on <3.10, so the CI3.9leg was a hollow shell (the flagship module untested).mypycan't even type-check atpython_version = "3.9"becauseanyio's source uses 3.10 syntax (themypy<2pin existed only to keep targeting 3.9).Changes:
requires-python = ">=3.10"; rufftarget-version = "py310"; mypypython_version = "3.10"; relaxmypy<2→mypy.anyio>=4.0as a direct dependency (it's imported directly bywaterdataviastart_blocking_portal; previously only transitive through httpx).["3.9", "3.13", "3.14"]→["3.10", "3.13", "3.14"].B905; added explicitstrict=Falseto the four pre-existingzip()calls (nwis,waterdata/chunking,waterdata/nearest) — identical to the prior implicit behavior, no semantic change.2. Remove deprecated
NWIS_Metadata.variable_infoIt only emitted a
DeprecationWarningand returnedNone(it relied on the defunctget_pmcodes). Accessing it now raisesNotImplementedErrorvia theutils.BaseMetadataabstract contract — the only deprecation cleanly removable now (the activenwisgetters stay until their announced 2027-05-06 date). Drops the obsolete unit test; theBaseMetadataabstract property is kept.Breaking changes
pip install dataretrieval>=1.2.0requires Python >=3.10.NWIS_Metadata.variable_infois removed (it always returnedNone).Verification
ruff check/ruff format --checkclean;mypy --strict dataretrieval/clean atpython_version = 3.10(the bump also resolves the anyio parse fragility newer mypy hits at 3.9).nwis,utils,waterdata/chunking).Part of a small set of 1.2.0 breaking-prep PRs (nadp/samples removal #330;
get_samplessnake_case #331).🤖 Generated with Claude Code