spatialmath-python icon indicating copy to clipboard operation
spatialmath-python copied to clipboard

[Issue-127] Pin version to match apt-installed python3-matplotlib

Open jcao-bdai opened this issue 6 months ago • 0 comments

Pin matplotlib version in pyproject.toml so that the installation won’t cause issue in ROS2 setups where matplotlib has been apt-installed and hence pinned to version 3.5.1. This particular version pinning also results in a narrower numpy version range "numpy>=1.22,<2" and an end of support for python 3.7.

This PR is a WIP.

Tests done:

  • [x] Testing workflow: all environments in test matrix are passing except for the following three, with error messages suggesting issues noted for each :
    • ubuntu + python 3.7, windows + python 3.7 (numpy does not have a version for this env);
    • windows + python 3.11, windows + python 3.12 (matplotlib does not provide a wheel for this env);
  • [x] In ROS2 Humble docker (ref https://docs.ros.org/en/humble/How-To-Guides/Run-2-nodes-in-single-or-separate-docker-containers.html):
    • [x] spatialmath-python pip install . (from source) recognized the existing apt-installed matplotlib and kept it without overwriting;
    • [x] "import spatialmath" worked when we further narrowed down numpy version range, due to TypeError: 'numpy._DTypeMeta' object is not subscriptable issue.

NOTE: the other part of the discussion, i.e. the matplotlib related imports should better be confined to sub modules where plotting is actually needed, is not resolved by this PR.

jcao-bdai avatar Jul 31 '24 22:07 jcao-bdai