Skip to content

Commit 3a6cad9

Browse files
thodson-usgsclaude
andcommitted
Bump declared Python floor to 3.9 to match CI
CI's matrix already tests only Python 3.9 / 3.13 / 3.14 (and the waterdata test module skips itself on <3.10), but pyproject.toml still declared requires-python = ">=3.8" and ruff was targeting py38. Bring the manifest in line with reality: - requires-python = ">=3.9" - [tool.ruff] target-version = "py39" That unblocks col.removesuffix("Date") in attach_datetime_columns (restored), and surfaces two pre-existing pyupgrade fixes that ruff now applies under the py39 target: - dataretrieval/waterdata/ratings.py: import Iterable from collections.abc instead of typing. - dataretrieval/waterdata/utils.py: zoneinfo is stdlib on 3.9+, so the ZoneInfo import moves into the stdlib group. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 6959475 commit 3a6cad9

4 files changed

Lines changed: 6 additions & 5 deletions

File tree

dataretrieval/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -150,7 +150,7 @@ def attach_datetime_columns(df):
150150
for col in df.columns:
151151
if not col.endswith("Date"):
152152
continue
153-
prefix = col[: -len("Date")]
153+
prefix = col.removesuffix("Date")
154154
target = prefix + "DateTime"
155155
if target in columns or target in new_columns:
156156
continue

dataretrieval/waterdata/ratings.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,8 @@
1414

1515
import logging
1616
import os
17-
from typing import Any, Iterable, Literal, get_args
17+
from collections.abc import Iterable
18+
from typing import Any, Literal, get_args
1819

1920
import pandas as pd
2021
import requests

dataretrieval/waterdata/utils.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@
66
import re
77
from datetime import datetime
88
from typing import Any, get_args
9+
from zoneinfo import ZoneInfo
910

1011
import pandas as pd
1112
import requests
12-
from zoneinfo import ZoneInfo
1313

1414
from dataretrieval import __version__
1515
from dataretrieval.utils import BaseMetadata

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ build-backend = "setuptools.build_meta"
66
name = "dataretrieval"
77
description = "Discover and retrieve water data from U.S. federal hydrologic web services."
88
readme = "README.md"
9-
requires-python = ">=3.8"
9+
requires-python = ">=3.9"
1010
keywords = ["USGS", "water data"]
1111
license = "CC0-1.0"
1212
license-files = ["LICENSE.md"]
@@ -63,7 +63,7 @@ repository = "https://github.com/DOI-USGS/dataretrieval-python.git"
6363
write_to = "dataretrieval/_version.py"
6464

6565
[tool.ruff]
66-
target-version = "py38"
66+
target-version = "py39"
6767
extend-exclude = ["demos"]
6868

6969
[tool.ruff.lint]

0 commit comments

Comments
 (0)