Skip to content

chore!: require Python >=3.10; remove deprecated NWIS_Metadata.variable_info (1.2.0)#332

Draft
thodson-usgs wants to merge 1 commit into
DOI-USGS:mainfrom
thodson-usgs:chore/require-python-310
Draft

chore!: require Python >=3.10; remove deprecated NWIS_Metadata.variable_info (1.2.0)#332
thodson-usgs wants to merge 1 commit into
DOI-USGS:mainfrom
thodson-usgs:chore/require-python-310

Conversation

@thodson-usgs

Copy link
Copy Markdown
Collaborator

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'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 (the flagship module untested).
  • Newer mypy can't even type-check at python_version = "3.9" because anyio's source uses 3.10 syntax (the mypy<2 pin existed only to keep targeting 3.9).

Changes:

  • requires-python = ">=3.10"; ruff target-version = "py310"; mypy python_version = "3.10"; relax mypy<2mypy.
  • Declare anyio>=4.0 as a direct dependency (it's imported directly by waterdata via start_blocking_portal; previously only transitive through httpx).
  • CI test matrix ["3.9", "3.13", "3.14"]["3.10", "3.13", "3.14"].
  • Trove classifiers filled in (per-version 3.10–3.14, dev-status, audience, topic).
  • The py310 ruff target newly enables B905; added explicit strict=False to the four pre-existing zip() calls (nwis, waterdata/chunking, waterdata/nearest) — identical to the prior implicit behavior, no semantic change.

2. 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 — the only deprecation cleanly removable now (the active nwis getters stay until their announced 2027-05-06 date). Drops the obsolete unit test; the BaseMetadata abstract property is kept.

Breaking changes

  • 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).

Verification

  • ruff check / ruff format --check clean; mypy --strict dataretrieval/ clean at python_version = 3.10 (the bump also resolves the anyio parse fragility newer mypy hits at 3.9).
  • 152 offline tests pass across the touched files (nwis, utils, waterdata/chunking).

Part of a small set of 1.2.0 breaking-prep PRs (nadp/samples removal #330; get_samples snake_case #331).

🤖 Generated with Claude Code

…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
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