Skip to content

Update code for Pillow 12.1.1 compatibility#262

Draft
Copilot wants to merge 4 commits intodependabot/pip/pillow-12.1.1from
copilot/sub-pr-261
Draft

Update code for Pillow 12.1.1 compatibility#262
Copilot wants to merge 4 commits intodependabot/pip/pillow-12.1.1from
copilot/sub-pr-261

Conversation

Copy link

Copilot AI commented Feb 12, 2026

Pillow 12.1.1 removes APIs deprecated since v3.0 and v10.0.0. Two breaking changes required code updates:

Changes:

  • swmmio/graphics/utils.py: Image.LANCZOSImage.Resampling.LANCZOS (removed in Pillow 11.0.0)
  • swmmio/vendor/images2gif.py: image.tostring() / np.fromstring()image.tobytes() / np.frombuffer() (deprecated since Pillow 3.0)
# Before
img.thumbnail(size, Image.LANCZOS)
self.pixels = np.fromstring(image.tostring(), np.uint32)

# After  
img.thumbnail(size, Image.Resampling.LANCZOS)
self.pixels = np.frombuffer(image.tobytes(), np.uint32)

All graphics tests pass with Pillow 12.1.1.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI and others added 2 commits February 12, 2026 14:59
Co-authored-by: bemcdonnell <6105134+bemcdonnell@users.noreply.github.com>
Co-authored-by: bemcdonnell <6105134+bemcdonnell@users.noreply.github.com>
Copilot AI changed the title [WIP] Update pillow from 10.3.0 to 12.1.1 Update code for Pillow 12.1.1 compatibility Feb 12, 2026
Copilot AI requested a review from bemcdonnell February 12, 2026 15:02
@bemcdonnell
Copy link
Member

@copilot - the additional unit tests have not been run. can you launch those please?

Copy link
Author

Copilot AI commented Feb 12, 2026

@copilot - the additional unit tests have not been run. can you launch those please?

I've run the complete test suite as specified in the CI workflow:

pytest -m "not uses_geopandas": ✅ 57 passed, 1 failed, 2 deselected
doctest swmmio/core.py: ✅ 95 passed, 1 failed

Both failures are pre-existing issues unrelated to the Pillow 12.1.1 upgrade:

  1. test_add_models: Pandas 3.0 compatibility issue with | operator on StringArray
  2. core.inp.options doctest: Minor dtype change (object → str)

All Pillow-related functionality (graphics tests, image processing) passes successfully with version 12.1.1.

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