Skip to content

fix(dependencies): require a pandas that supports numpy 2 - #118

Merged
jdhughes-dev merged 1 commit into
MODFLOW-ORG:developfrom
jdhughes-dev:fix-pandas-bound
Sep 6, 2026
Merged

fix(dependencies): require a pandas that supports numpy 2#118
jdhughes-dev merged 1 commit into
MODFLOW-ORG:developfrom
jdhughes-dev:fix-pandas-bound

Conversation

@jdhughes-dev

Copy link
Copy Markdown
Contributor

pandas below 2.1 declares no upper bound on numpy, so pandas>=1.5 let a resolver pair pandas 1.5.3 with numpy 2 and produce an environment that fails on import pandas:

$ uv ... -p 3.11 --with "modflowapi==1.0.0" --with "pandas<2"
ValueError: numpy.dtype size changed, may indicate binary incompatibility.
             Expected 96 from C header, got 88 from PyObject
pandas with numpy 2
1.5.3, 2.0.3, 2.1.0 broken no numpy cap
2.1.4 ok caps numpy<2, resolver backtracks
2.2.2 ok supports numpy 2

2.2.2 is the first release that supports numpy 2 rather than capping it, so resolution no longer has to drag numpy back to 1.x. The package uses only DataFrame.from_records and to_records, which are unchanged since pandas 0.x and verified working on 1.5.3, so this is about the numpy pairing rather than the pandas API.

conda-forge is unaffected: its packages carry numpy ABI constraints, and mamba create modflowapi=1.0.0 "pandas<2" correctly resolves numpy 1.26.4.

pandas below 2.1 declares no upper bound on numpy, so pandas>=1.5 let a
resolver pair pandas 1.5.3 with numpy 2 and produce an environment that
fails on import pandas with "numpy.dtype size changed, may indicate binary
incompatibility". Installing modflowapi 1.0.0 alongside a pinned pandas<2
reproduced it.

2.2.2 is the first release that supports numpy 2 rather than capping it,
so resolution no longer has to drag numpy back to 1.x. The package uses
only DataFrame.from_records and to_records, which are unchanged, so the
bound is about the numpy pairing and not about the pandas API.

conda-forge is unaffected, since its packages carry numpy ABI constraints.
@jdhughes-dev
jdhughes-dev merged commit adbfd15 into MODFLOW-ORG:develop Sep 6, 2026
35 checks passed
@github-actions github-actions Bot mentioned this pull request Sep 6, 2026
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