chore!: require Python >=3.10; remove deprecated NWIS_Metadata.variable_info (1.2.0)#332
Merged
thodson-usgs merged 1 commit intoJun 24, 2026
Conversation
ffe2059 to
ff7fcbb
Compare
…tadata property 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 require 3.10+, and the `waterdata` test modules already skipped on <3.10. `requires-python = ">=3.10"`; ruff `target-version = "py310"`; mypy `python_version = "3.10"` (drops the `mypy<2` pin that only existed to keep targeting 3.9); declare `anyio>=4.0` as a direct dependency (imported directly by `waterdata`); CI matrix `["3.10", "3.13", "3.14"]`; fill in per-version Trove classifiers. - The py310 ruff target newly enables `B905` (zip `strict=`) and `UP036` (now-dead `sys.version_info < (3, 10)` skip guards): add explicit `strict=False` to the remaining `zip()` calls (`nwis`, `ogc/planning`, `waterdata/nearest`) and drop the dead version-skip guards in the four `waterdata` test modules. Behavior-identical. Remove the deprecated `variable_info` metadata property entirely - The `NWIS_Metadata` override only warned and returned `None` (it relied on the defunct `get_pmcodes`). Nothing else implemented it, so the `BaseMetadata` abstract is removed too — accessing `.variable_info` now raises `AttributeError`. - `site_info` is kept: `NWIS_Metadata`/`WQP_Metadata` implement it, and the modern `waterdata` metadata intentionally leaves it abstract (use `waterdata.get_monitoring_locations()` for site descriptions). Fix the live-API flaky-rerun marker - A live test that hits an SSL/connection timeout surfaces as a typed `NetworkError`, but the `flaky_api` rerun patterns matched only the raw httpx exception names. `pytest-rerunfailures` matches the crash line (the `NetworkError`), not the chained `ConnectTimeout`, so the transient was never retried and failed CI. Add `NetworkError` to `_TRANSIENT_RERUN_PATTERNS`. BREAKING CHANGE: Python 3.9 is no longer supported; `pip install dataretrieval>=1.2.0` requires Python >=3.10. The `variable_info` metadata property is removed (it always returned `None`); use `site_info` or `waterdata.get_monitoring_locations()`. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Sjb14HkwuCydKSKMsaXsgd
ff7fcbb to
39fe73f
Compare
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