Skip to content

[shapely] Changes for new features and updates made in Release 2.2.0 - #16562

Draft
jack-volantautonomy wants to merge 7 commits into
python:mainfrom
jack-volantautonomy:shapely-2_2_0-typeshed-update
Draft

jack-volantautonomy wants to merge 7 commits into
python:mainfrom
jack-volantautonomy:shapely-2_2_0-typeshed-update

Conversation

@jack-volantautonomy

Copy link
Copy Markdown
Contributor

This PR aims to provide type support for the latest 2.2.0 release in shapely which comes with new features, deprecations, and more tweaks.

@github-actions

This comment has been minimized.

@jack-volantautonomy
jack-volantautonomy marked this pull request as draft October 19, 2026 09:47
@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

This comment has been minimized.

@github-actions

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

@thomas-maschler

Copy link
Copy Markdown
Contributor

Thanks for picking this up! A few things from checking against shapely 2.2.0 at runtime:

  • split and minimum_width return an ndarray for array input, so the sequence overloads should return GeoArray. The first three minimum_width overloads can collapse into Geometry -> LineString, since they all return the same type. Also, with GEOS older than 3.15 (including the bundled 3.14.1 wheels), split falls back to ops.split, and split(None, p) raises AttributeError.
  • The lib.*_scalar functions are internal fast paths, and there are 109 of them at runtime. Allowlisting them would be simpler than stubbing them: shapely\.lib\..*_scalar in @tests/stubtest_allowlist.txt.
  • Stubtest still flags coverage_clean and lib.minimum_width as missing, lib.make_valid as removed, the __new__ parameter rename from self to cls on the geometry classes, BaseGeometry.__nonzero__, ParamEnum.has_value, and the _version changes from the meson build.
  • Stubtest can't catch these: prepare and destroy_prepared now return bool (#2359), and ops.transform and multithreading_enabled are deprecated in 2.2.0, so they could get @deprecated.
  • The pyrefly crash looks unrelated. Rebasing on main should clear it.

This branch has not been deployed

No deployments
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.

2 participants