Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Compatibility with shapely 2.0 (remove usage of lgeos) #2080

Merged
merged 6 commits into from
Oct 18, 2022

Conversation

jorisvandenbossche
Copy link
Contributor

@jorisvandenbossche jorisvandenbossche commented Sep 12, 2022

Rationale

See #2076.

It is actually relatively easy to remove the usage of shapely.geos.lgeos, which is removed in Shapely 2.0, as a first step to make cartopy compatible with Shapely 2.0 (without making use of new features).

I think this should actually be a safe change to include in a 0.21.1 bug-fix release, in case that would be planned.

Now, while this is a necessary change to run the test suite with Shapely 2.0, there are still some other failures, but for things that potentially can be fixed on Shapely's side (see #2076 (comment) for details)

@greglucas
Copy link
Contributor

@jorisvandenbossche, thanks for the patch! I agree that this seems reasonable for a patch release. Can you revert all the pins throughout the documentation?
ad1ec1a

Cartopy was not compatible with MPL 3.6 or Shapely 2.0, so we were trying to get ahead of the MPL 3.6 release. I am not opposed to turning this around for a quick v0.21.1 tag to remove the pin on Shapely though so more people can test.

@jorisvandenbossche
Copy link
Contributor Author

Reverted the pins (and all required PRs on the Shapely side are now fixed)

@jorisvandenbossche
Copy link
Contributor Author

The doc build failure seems unrelated?

@dopplershift
Copy link
Contributor

I dug into the doc failure and it's from Matplotlib 3.6: matplotlib/matplotlib#24053.

@felixdivo
Copy link

The Shapely team just published version 2.0b1, so this might be a good point in time to publish this Cartopy improvement and (let the community) test them together. 😄

@greglucas greglucas merged commit 3d2f673 into SciTools:main Oct 18, 2022
@greglucas greglucas added this to the 0.22 milestone Oct 18, 2022
@jorisvandenbossche jorisvandenbossche deleted the compat-shapely-2 branch October 18, 2022 13:58
@jorisvandenbossche
Copy link
Contributor Author

Yes, shapely 2.0b1 should contain all fixes to have this working.

You could replace the pip install git+https://github.com/shapely/shapely.git@main with pip install --pre

@felixdivo
Copy link

Is there an estimate on when the next version of Cartopy will be released? :)

@greglucas
Copy link
Contributor

Not yet. We could make a patch release, but I think it'd be good if we settled on #2083 first to try and add that to the release.

@felixdivo
Copy link

felixdivo commented Nov 23, 2022

That sounds reasonable. And as long as shapely 2.0 is not stable, this won't cause too many people to ask for cartopy to support it.

Thank you for the insight. 😄

@jorisvandenbossche
Copy link
Contributor Author

jorisvandenbossche commented Dec 7, 2022

Just a heads up that I am planning to release a final shapely 2.0 in a few days.

So it would be nice to either have a 0.21 patch release with this fix included, or a not to too distant timeline for 0.22

@greglucas
Copy link
Contributor

@jorisvandenbossche, thanks for the heads up. Would you mind cherry-picking this commit over and targeting the v0.21.x branch? Then I can merge that and make a new patch release. That will be the easiest quick path since the 0.22 PR discussion has stalled (feel free to drop a comment over there if you have thoughts on speed vs ease-of-use for your library end-users).

@jorisvandenbossche
Copy link
Contributor Author

Would you mind cherry-picking this commit over and targeting the v0.21.x branch? Then I can merge that and make a new patch release

-> opened #2110

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants