Skip to content

Commit 7f2e973

Browse files
authored
Drop Python 3.10 support (#2012)
I tried to add 3.13 to as the default environment but this cannot resolve yet due to for instance numba not supporting it yet (via the xugrid) optional dependency. Also adds compat bounds for our python depdencies. This follows https://scientific-python.org/specs/spec-0000/.
1 parent 758f535 commit 7f2e973

File tree

12 files changed

+365
-5819
lines changed

12 files changed

+365
-5819
lines changed

.github/workflows/python_tests.yml

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,6 @@ jobs:
2424
pixi-environment:
2525
- py312
2626
- py311
27-
- py310
2827
steps:
2928
- uses: actions/checkout@v4
3029
- uses: prefix-dev/[email protected]

pixi.lock

Lines changed: 320 additions & 5776 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pixi.toml

Lines changed: 12 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -166,33 +166,33 @@ install-ci = { depends-on = [
166166
] }
167167

168168
[dependencies]
169-
geopandas = "*"
169+
geopandas = ">=1.0"
170170
hatchling = "*"
171171
ipykernel = ">=6.29"
172-
ipywidgets = ">=8.1.3,<8.2"
172+
ipywidgets = ">=8.1.3"
173173
jinja2 = "*"
174-
matplotlib = "*"
174+
matplotlib = ">=3.7"
175175
minio = "*"
176176
netcdf4 = "*"
177177
networkx = ">=3.3"
178-
numpy = "*"
179-
pandas = "*"
178+
numpy = ">=1.25"
179+
pandas = ">=2.0"
180180
pandas-stubs = "*"
181181
pandera = ">=0.20"
182182
pip = "*"
183-
pyarrow = "*"
184-
pydantic = ">=2"
185-
pyogrio = "*"
183+
pyarrow = ">=17.0"
184+
pydantic = ">=2.0"
185+
pyogrio = ">=0.8"
186186
pytest = "*"
187187
pytest-cov = "*"
188188
pytest-xdist = "*"
189-
python = ">=3.10"
189+
python = ">=3.11"
190190
shapely = ">=2.0"
191191
teamcity-messages = "*"
192-
tomli = "*"
193-
tomli-w = "*"
192+
tomli = ">=2.0"
193+
tomli-w = ">=1.0"
194194
xarray = "*"
195-
xmipy = "*"
195+
xmipy = ">=1.3"
196196
xugrid = "*"
197197

198198
[pypi-dependencies]
@@ -226,9 +226,6 @@ python = "3.12.*"
226226
[feature.py311.dependencies]
227227
python = "3.11.*"
228228

229-
[feature.py310.dependencies]
230-
python = "3.10.*"
231-
232229
[target.win-64.dependencies]
233230
rcedit = "*"
234231

@@ -237,7 +234,6 @@ default = { features = ["py312"], solve-group = "py312" }
237234
dev = { features = ["py312", "dev"], solve-group = "py312" }
238235
py312 = { features = ["py312"], solve-group = "py312" }
239236
py311 = ["py311"]
240-
py310 = ["py310"]
241237

242238
[system-requirements]
243239
linux = "3.10.0"

python/ribasim/pyproject.toml

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -14,19 +14,19 @@ classifiers = [
1414
"Intended Audience :: Science/Research",
1515
"Topic :: Scientific/Engineering :: Hydrology",
1616
]
17-
requires-python = ">=3.10"
17+
requires-python = ">=3.11"
1818
dependencies = [
19-
"geopandas",
20-
"matplotlib",
21-
"numpy",
22-
"pandas",
23-
"pandera >= 0.20",
24-
"pyarrow",
25-
"pydantic ~= 2.0",
26-
"pyogrio",
27-
"shapely >= 2.0",
28-
"tomli",
29-
"tomli-w",
19+
"geopandas >=1.0",
20+
"matplotlib >=3.7",
21+
"numpy >=1.25",
22+
"pandas >=2.0",
23+
"pandera >=0.20",
24+
"pyarrow >=17.0",
25+
"pydantic >=2.0",
26+
"pyogrio >=0.8",
27+
"shapely >=2.0",
28+
"tomli >=2.0",
29+
"tomli-w >=1.0",
3030
]
3131
dynamic = ["version"]
3232

python/ribasim/ribasim/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import numbers
22
from collections.abc import Sequence
33
from enum import Enum
4-
from typing import Any, Optional
4+
from typing import Any
55

66
import numpy as np
77
import pandas as pd
@@ -175,7 +175,7 @@ class Node(pydantic.BaseModel):
175175
Optionally adds this node to a subnetwork, which is input for the allocation algorithm.
176176
"""
177177

178-
node_id: Optional[NonNegativeInt] = None
178+
node_id: NonNegativeInt | None = None
179179
geometry: Point
180180
name: str = ""
181181
subnetwork_id: int | None = None
@@ -184,7 +184,7 @@ class Node(pydantic.BaseModel):
184184

185185
def __init__(
186186
self,
187-
node_id: Optional[NonNegativeInt] = None,
187+
node_id: NonNegativeInt | None = None,
188188
geometry: Point = Point(),
189189
**kwargs,
190190
) -> None:

python/ribasim/ribasim/geometry/edge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
from typing import NamedTuple, Optional
1+
from typing import NamedTuple
22

33
import matplotlib.pyplot as plt
44
import numpy as np
@@ -72,7 +72,7 @@ def add(
7272
to_node: NodeData,
7373
geometry: LineString | MultiLineString | None = None,
7474
name: str = "",
75-
edge_id: Optional[NonNegativeInt] = None,
75+
edge_id: NonNegativeInt | None = None,
7676
**kwargs,
7777
):
7878
"""

python/ribasim/ribasim/input_base.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -169,7 +169,7 @@ class TableModel(FileModel, Generic[TableT]):
169169
@classmethod
170170
def _check_schema(cls, v: DataFrame[TableT]):
171171
"""Allow only extra columns with `meta_` prefix."""
172-
if isinstance(v, (pd.DataFrame, gpd.GeoDataFrame)):
172+
if isinstance(v, pd.DataFrame | gpd.GeoDataFrame):
173173
# On reading from geopackage, migrate the tables when necessary
174174
db_path = context_file_loading.get().get("database")
175175
if db_path is not None:
@@ -435,7 +435,7 @@ def set_modeld(
435435
@classmethod
436436
def set_sort_keys(cls, v: Any, info: ValidationInfo) -> Any:
437437
"""Set sort keys for all TableModels if present in FieldInfo."""
438-
if isinstance(v, (TableModel,)):
438+
if isinstance(v, TableModel):
439439
field = cls.model_fields[getattr(info, "field_name")]
440440
extra = field.json_schema_extra
441441
if extra is not None and isinstance(extra, dict):

python/ribasim/ribasim/schemas.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Automatically generated file. Do not modify.
22

3-
from typing import Annotated, Any, Callable
3+
from collections.abc import Callable
4+
from typing import Annotated, Any
45

56
import pandas as pd
67
import pandera as pa

python/ribasim_api/pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ classifiers = [
1212
"Intended Audience :: Science/Research",
1313
"Topic :: Scientific/Engineering :: Hydrology",
1414
]
15-
requires-python = ">=3.10"
15+
requires-python = ">=3.11"
1616
dependencies = [
17-
"xmipy"
17+
"xmipy >=1.3"
1818
]
1919
dynamic = ["version"]
2020

python/ribasim_testmodels/pyproject.toml

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,13 @@ classifiers = [
1212
"Intended Audience :: Science/Research",
1313
"Topic :: Scientific/Engineering :: Hydrology",
1414
]
15-
requires-python = ">=3.10"
16-
dependencies = ["ribasim", "geopandas", "numpy", "pandas"]
15+
requires-python = ">=3.11"
16+
dependencies = [
17+
"geopandas >=1.0",
18+
"numpy >=1.25",
19+
"pandas >=2.0",
20+
"ribasim",
21+
]
1722
dynamic = ["version"]
1823

1924
[project.optional-dependencies]

0 commit comments

Comments
 (0)