From b51fd53e926b85e81b5dc79b8a4aee5acb358d52 Mon Sep 17 00:00:00 2001 From: John Barnett Date: Fri, 25 Oct 2024 09:47:32 -0400 Subject: [PATCH 1/3] Move matplotlib version pinning to an optional dependency --- pyproject.toml | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/pyproject.toml b/pyproject.toml index cead2ac3..00b2f424 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -38,7 +38,7 @@ keywords = [ dependencies = [ "numpy>=1.22,<2", # Cannot use 2.0 due to matplotlib version pinning. "scipy", - "matplotlib==3.5.1", # Large user-base has apt-installed python3-matplotlib (ROS2) which is pinned to this version. + "matplotlib", "ansitable", "typing_extensions", "pre-commit", @@ -70,6 +70,10 @@ docs = [ "sphinx-autodoc-typehints", ] +ROS2-humble = [ + "matplotlib==3.5.1", # Large user-base has apt-installed python3-matplotlib (ROS2) which is pinned to this version. +] + [build-system] requires = ["setuptools", "oldest-supported-numpy"] From f9c05a2a2bbe24bbbaa1fa4182cf36b60ec56be7 Mon Sep 17 00:00:00 2001 From: John Barnett Date: Fri, 10 Jan 2025 11:44:52 -0500 Subject: [PATCH 2/3] Move optional dependency on numpy<2 into (renamed) ros-humble section --- pyproject.toml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/pyproject.toml b/pyproject.toml index 00b2f424..4295f2f3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -36,7 +36,7 @@ keywords = [ ] dependencies = [ - "numpy>=1.22,<2", # Cannot use 2.0 due to matplotlib version pinning. + "numpy>=1.22", "scipy", "matplotlib", "ansitable", @@ -70,8 +70,9 @@ docs = [ "sphinx-autodoc-typehints", ] -ROS2-humble = [ +ros-humble = [ "matplotlib==3.5.1", # Large user-base has apt-installed python3-matplotlib (ROS2) which is pinned to this version. + "numpy<2", # Cannot use 2.0 due to matplotlib version pinning. ] [build-system] From 5d2d837fbdee0e407ea0a2baba4ef625a2b97306 Mon Sep 17 00:00:00 2001 From: John Barnett Date: Fri, 10 Jan 2025 13:00:59 -0500 Subject: [PATCH 3/3] Updated README.md with information on using optional dependencies for version pinning on ros-humble. --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/README.md b/README.md index 3efadf10..a2db78e4 100644 --- a/README.md +++ b/README.md @@ -122,6 +122,13 @@ Install a snapshot from PyPI pip install spatialmath-python ``` +Note that if you are using ROS2, you may run into version conflicts when using `rosdep`, particularly +concerning `matplotlib`. If this happens, you can enable optional version pinning with + +``` +pip install spatialmath-python[ros-humble] +``` + ## From GitHub Install the current code base from GitHub and pip install a link to that cloned copy