ESMValGroup / ESMValCore

ESMValCore: A community tool for pre-processing data from Earth system models in CMIP and running analysis scripts.
https://www.esmvaltool.org
Apache License 2.0
42 stars 38 forks source link

`esmvalcore=2.7.1` (and older) incompatoble with `shapely=2.0.0` (current workaround in ESMValTool: we pinned to `shapely<2.0`) #1874

Closed valeriupredoi closed 1 year ago

valeriupredoi commented 1 year ago

esmvalcore=2.7.1 package, and older versions too, are incompatible with latest shapely=2.0.0 because they have removed the vectorized package; our setup.py for v2.7.1, off the v2.7.x branch needs shapely[vectorized] as dependency, which breaks package manager in ESMValTool, and any entry point operation associated with ESMValTool. This is how setuptools/pkg_resources sees the deps table:

[Requirement.parse('cartopy'), Requirement.parse('cf-units'), Requirement.parse('dask[array]'), Requirement.parse('esgf-pyclient>=0.3.1'), Requirement.parse('esmpy!=8.1.0'), Requirement.parse('fiona'), Requirement.parse('fire'), Requirement.parse('geopy'), Requirement.parse('humanfriendly'), Requirement.parse('isodate'), Requirement.parse('jinja2'), Requirement.parse('nc-time-axis'), Requirement.parse('nested-lookup'), Requirement.parse('netCDF4'), Requirement.parse('numpy'), Requirement.parse('pandas'), Requirement.parse('pillow'), Requirement.parse('prov'), Requirement.parse('psutil'), Requirement.parse('pybtex'), Requirement.parse('pyyaml'), Requirement.parse('requests'), Requirement.parse('scipy>=1.6'), Requirement.parse('scitools-iris>=3.2.1'), Requirement.parse('shapely[vectorized]'), Requirement.parse('stratify'), Requirement.parse('yamale')]

and brown matter hits the fan when extracting the vectorized key from shapely since 2.0.0 don't have it no more.

We have two solutions to choose from:

@ESMValGroup/technical-lead-development-team please chime in! :beer:

zklaus commented 1 year ago

For the conda-forge package, we could also patch this out in a new build, but I am actually leaning towards a 2.7.2.

valeriupredoi commented 1 year ago

@zklaus me too! But depending on the outcome of https://github.com/shapely/shapely/issues/1669 we may get functionality back (even if vectorized is just a shimmy, but at least it won't break the install and setuptools). I say we should wait a bit see what @jorisvandenbossche and his colleagues decide - surely not gonna do a v2.7.2 release before the new year :christmas_tree:

glpotter commented 1 year ago

So what do I do? I have a new installation on Linux and when I try to run ESMvalTool I get:

pkg_resources.UnknownExtra: shapely 2.0.0 has no such extra feature 'vectorized'

And it fails. I tried pip install shapely[vectorized] but it made no difference.

bouweandela commented 1 year ago

You can run pip install 'shapely[vectorized]<2'. This will install the latest version 1.x of shapely, which still had the installation option vectorized.

valeriupredoi commented 1 year ago

shapely=2.0.1 (current) is fine with shapely[vectorized], even if that seems to be a shimmy. But for the purpose of this issue, all seems to be functional, so am closing (will reopen if needed_