Skip to content

Require regionmask >=0.13 - #29

Merged
hdrake merged 3 commits into
mainfrom
pin-regionmask
Jul 30, 2026
Merged

Require regionmask >=0.13#29
hdrake merged 3 commits into
mainfrom
pin-regionmask

Conversation

@hdrake

@hdrake hdrake commented Jul 30, 2026

Copy link
Copy Markdown
Owner

What this changes

regionate/grid_conform.py calls regionmask.mask_geopandas (three sites), which
regionmask did not gain until 0.6. The dependency was declared with no lower bound
in both pyproject.toml and conda/meta.yaml, so any resolver was free to pick a
regionmask that lacks the function.

That is not hypothetical. Building the conda-forge feedstock for 0.5.6 solved to
regionmask 0.4.0 (2019), which contains no mask_geopandas — its __init__
still exports the Regions_cls / create_mask_contains API. The resulting package
imports fine and then dies at mask time. The feedstock build happened to fail for an
unrelated reason (pip check rejecting that package's stale Tag: cp36-none-any
wheel metadata), which is the only reason it was not published.

Changes

  • pyproject.toml: regionmaskregionmask >= 0.13
  • conda/meta.yaml: regionmaskregionmask >=0.13

Floor set at 0.13 rather than the bare API minimum of 0.6 because 0.13 is the version
the suite is actually run against. No upper bound — a ceiling here would recreate the
kind of stale cap that forces resolvers backwards.

Validation

  • pytest passes (2 passed) in a clean environment resolving to regionmask 0.13.0,
    geopandas 1.1.4, rasterio 1.5.0, numpy 2.4.6, sectionate 0.3.4.
  • A cross-platform conda create --dry-run --platform linux-64 with regionmask>=0.13
    solves cleanly: regionmask 0.13.0, rasterio 1.4.4, pooch 1.9.0, numpy 2.4.6.
  • No test is added: the change is a dependency floor, and CI installing the package
    and running the suite is what exercises it. A test asserting a version number would
    only restate the metadata.

Follow-ups not in this PR

conda/meta.yaml is stale in two other ways, left alone to keep this diff single-purpose:
{% set version = "0.5.5" %} with a 0.5.5 sha256, and sectionate >=0.3.3 where
upstream now says >=0.3.4,<0.4.

hdrake and others added 3 commits July 29, 2026 22:45
`grid_conform.py` calls `regionmask.mask_geopandas`, added in regionmask 0.6.
The dependency was unbounded in both `pyproject.toml` and `conda/meta.yaml`, so
a resolver was free to select a pre-0.6 regionmask. conda-forge's solver did
exactly that when building the feedstock: it picked regionmask 0.4.0 (2019),
which ships no `mask_geopandas` at all, producing an environment that imports
cleanly and then fails at mask time.

Pin the floor at 0.13, the version the test suite is run against, rather than at
the bare API minimum of 0.6. No upper bound -- a ceiling here would recreate the
kind of stale cap that forces resolvers backwards.

Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>

@hdrake hdrake left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good.

@hdrake
hdrake merged commit 8ef8cda into main Jul 30, 2026
4 of 5 checks passed
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