Require regionmask >=0.13 - #29
Merged
Merged
Conversation
`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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What this changes
regionate/grid_conform.pycallsregionmask.mask_geopandas(three sites), whichregionmask did not gain until 0.6. The dependency was declared with no lower bound
in both
pyproject.tomlandconda/meta.yaml, so any resolver was free to pick aregionmask 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_containsAPI. The resulting packageimports fine and then dies at mask time. The feedstock build happened to fail for an
unrelated reason (
pip checkrejecting that package's staleTag: cp36-none-anywheel metadata), which is the only reason it was not published.
Changes
pyproject.toml:regionmask→regionmask >= 0.13conda/meta.yaml:regionmask→regionmask >=0.13Floor 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
pytestpasses (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.
conda create --dry-run --platform linux-64withregionmask>=0.13solves cleanly: regionmask 0.13.0, rasterio 1.4.4, pooch 1.9.0, numpy 2.4.6.
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.yamlis stale in two other ways, left alone to keep this diff single-purpose:{% set version = "0.5.5" %}with a 0.5.5sha256, andsectionate >=0.3.3whereupstream now says
>=0.3.4,<0.4.