Dependency Version Constraint Allows Breaking Changes in pymunk
The current project dependency specification only constrains pymunk to versions greater than 6.2.0:
|
sisl = ["pygame>=2.3.0", "pymunk>=6.2.0", "box2d-py>=2.3.5", "scipy>=1.4.1"] |
However, according to the official pymunk changelog, version 7.0.0 introduces a significant breaking change to the CollisionHandler API:
https://www.pymunk.org/en/latest/changelog.html#pymunk-7-0-0-2025-05-28
As a result, existing code paths that rely on the pre-7.0.0 CollisionHandler behavior will fail when a newer pymunk version is installed. For example, the following usage is no longer compatible:
|
self.space.add_collision_handler( |
Specifically, calls such as self.space.add_collision_handler(...) break under pymunk ≥ 7.0.0.
Code example
from pettingzoo.sisl import waterworld_v4
env = waterworld_v4.parallel_env()
env.reset()
System info
PettingZoo version: 1.25.0
Ubuntu 2204
Python 3.12.9
Suggested Resolution
- Add an explicit upper bound on the pymunk dependency (e.g.,
<7.0.0), or
- Update the affected code to be compatible with pymunk ≥ 7.0.0
Checklist
Dependency Version Constraint Allows Breaking Changes in
pymunkThe current project dependency specification only constrains
pymunkto versions greater than6.2.0:PettingZoo/pyproject.toml
Line 43 in 9c1c5f1
PettingZoo/pyproject.toml
Line 60 in 9c1c5f1
However, according to the official pymunk changelog, version 7.0.0 introduces a significant breaking change to the
CollisionHandlerAPI:https://www.pymunk.org/en/latest/changelog.html#pymunk-7-0-0-2025-05-28
As a result, existing code paths that rely on the pre-7.0.0
CollisionHandlerbehavior will fail when a newer pymunk version is installed. For example, the following usage is no longer compatible:PettingZoo/pettingzoo/sisl/waterworld/waterworld_base.py
Line 321 in 9c1c5f1
Specifically, calls such as
self.space.add_collision_handler(...)break under pymunk ≥ 7.0.0.Code example
System info
PettingZoo version: 1.25.0
Ubuntu 2204
Python 3.12.9
Suggested Resolution
<7.0.0), orChecklist