From 9b6f7c603bc98dad1853a28128159e71c3ef2285 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 19 Apr 2024 17:25:08 +0200 Subject: [PATCH 1/2] Mention potential issue with pytest when ros2 is installed --- .../tutorial-install-python-bindings.dox | 132 ++++++++++++++++++ 1 file changed, 132 insertions(+) diff --git a/doc/tutorial/python/tutorial-install-python-bindings.dox b/doc/tutorial/python/tutorial-install-python-bindings.dox index 4ac4a8b5a3..9d31e35787 100644 --- a/doc/tutorial/python/tutorial-install-python-bindings.dox +++ b/doc/tutorial/python/tutorial-install-python-bindings.dox @@ -831,4 +831,136 @@ Then it means that a class has both a static method and a member method with the This error may also happen when generating the Python stubs (after the bindings compilation and linking step). +\subsubsection py_bindings_known_errors_test When building the tests + +The following error may occur when building Python tests on Ubuntu 22.04 when ROS-2 humble is installed: + +\verbatim +(venv) $ cd $VISP_WS/visp-build-bindings +(venv) $ make -j8 visp_python_bindings_test +\endverbatim + +The error is the following: +\verbatim +... +[100%] Built target visp_python_bindings +[100%] Installing dependencies to test Python bindings... +Collecting numpy (from -r $VISP_WS/visp/modules/python/test/requirements.txt (line 1)) + Downloading numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.metadata (61 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 61.0/61.0 kB 1.3 MB/s eta 0:00:00 +Collecting pytest (from -r $VISP_WS/visp/modules/python/test/requirements.txt (line 2)) + Downloading pytest-8.1.1-py3-none-any.whl.metadata (7.6 kB) +Collecting pytest-sphinx (from -r $VISP_WS/visp/modules/python/test/requirements.txt (line 3)) + Downloading pytest_sphinx-0.6.3-py3-none-any.whl.metadata (5.3 kB) +Collecting iniconfig (from pytest->-r $VISP_WS/visp/modules/python/test/requirements.txt (line 2)) + Downloading iniconfig-2.0.0-py3-none-any.whl.metadata (2.6 kB) +Collecting packaging (from pytest->-r $VISP_WS/visp/modules/python/test/requirements.txt (line 2)) + Downloading packaging-24.0-py3-none-any.whl.metadata (3.2 kB) +Collecting pluggy<2.0,>=1.4 (from pytest->-r $VISP_WS/visp/modules/python/test/requirements.txt (line 2)) + Downloading pluggy-1.4.0-py3-none-any.whl.metadata (4.3 kB) +Collecting exceptiongroup>=1.0.0rc8 (from pytest->-r $VISP_WS/visp/modules/python/test/requirements.txt (line 2)) + Downloading exceptiongroup-1.2.0-py3-none-any.whl.metadata (6.6 kB) +Collecting tomli>=1 (from pytest->-r $VISP_WS/visp/modules/python/test/requirements.txt (line 2)) + Downloading tomli-2.0.1-py3-none-any.whl.metadata (8.9 kB) +Downloading numpy-1.26.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (18.2 MB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 18.2/18.2 MB 12.6 MB/s eta 0:00:00 +Downloading pytest-8.1.1-py3-none-any.whl (337 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 337.4/337.4 kB 17.0 MB/s eta 0:00:00 +Downloading pytest_sphinx-0.6.3-py3-none-any.whl (10 kB) +Downloading exceptiongroup-1.2.0-py3-none-any.whl (16 kB) +Downloading pluggy-1.4.0-py3-none-any.whl (20 kB) +Downloading tomli-2.0.1-py3-none-any.whl (12 kB) +Downloading iniconfig-2.0.0-py3-none-any.whl (5.9 kB) +Downloading packaging-24.0-py3-none-any.whl (53 kB) + ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 53.5/53.5 kB 5.8 MB/s eta 0:00:00 +Installing collected packages: tomli, pluggy, packaging, numpy, iniconfig, exceptiongroup, pytest, pytest-sphinx +Successfully installed exceptiongroup-1.2.0 iniconfig-2.0.0 numpy-1.26.4 packaging-24.0 pluggy-1.4.0 pytest-8.1.1 pytest-sphinx-0.6.3 tomli-2.0.1 + +[notice] A new release of pip is available: 23.3.2 -> 24.0 +[notice] To update, run: pip install --upgrade pip +[100%] Built target visp_python_bindings_test_dependencies +[100%] Testing Python bindings... +Traceback (most recent call last): + File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main + return _run_code(code, main_globals, None, + File "/usr/lib/python3.10/runpy.py", line 86, in _run_code + exec(code, run_globals) + File "$VISP_WS/venv/lib/python3.10/site-packages/pytest/__main__.py", line 7, in + raise SystemExit(pytest.console_main()) + File "$VISP_WS/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 197, in console_main + code = main() + File "$VISP_WS/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 155, in main + config = _prepareconfig(args, plugins) + File "$VISP_WS/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 337, in _prepareconfig + config = pluginmanager.hook.pytest_cmdline_parse( + File "$VISP_WS/venv/lib/python3.10/site-packages/pluggy/_hooks.py", line 501, in __call__ + return self._hookexec(self.name, self._hookimpls.copy(), kwargs, firstresult) + File "$VISP_WS/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 119, in _hookexec + return self._inner_hookexec(hook_name, methods, kwargs, firstresult) + File "$VISP_WS/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 138, in _multicall + raise exception.with_traceback(exception.__traceback__) + File "$VISP_WS/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 121, in _multicall + teardown.throw(exception) # type: ignore[union-attr] + File "$VISP_WS/venv/lib/python3.10/site-packages/_pytest/helpconfig.py", line 105, in pytest_cmdline_parse + config = yield + File "$VISP_WS/venv/lib/python3.10/site-packages/pluggy/_callers.py", line 102, in _multicall + res = hook_impl.function(*args) + File "$VISP_WS/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1143, in pytest_cmdline_parse + self.parse(args) + File "$VISP_WS/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1492, in parse + self._preparse(args, addopts=addopts) + File "$VISP_WS/venv/lib/python3.10/site-packages/_pytest/config/__init__.py", line 1379, in _preparse + self.pluginmanager.load_setuptools_entrypoints("pytest11") + File "$VISP_WS/venv/lib/python3.10/site-packages/pluggy/_manager.py", line 414, in load_setuptools_entrypoints + plugin = ep.load() + File "/usr/lib/python3.10/importlib/metadata/__init__.py", line 171, in load + module = import_module(match.group('module')) + File "/usr/lib/python3.10/importlib/__init__.py", line 126, in import_module + return _bootstrap._gcd_import(name[level:], package, level) + File "", line 1050, in _gcd_import + File "", line 1027, in _find_and_load + File "", line 992, in _find_and_load_unlocked + File "", line 241, in _call_with_frames_removed + File "", line 1050, in _gcd_import + File "", line 1027, in _find_and_load + File "", line 992, in _find_and_load_unlocked + File "", line 241, in _call_with_frames_removed + File "", line 1050, in _gcd_import + File "", line 1027, in _find_and_load + File "", line 1006, in _find_and_load_unlocked + File "", line 688, in _load_unlocked + File "", line 883, in exec_module + File "", line 241, in _call_with_frames_removed + File "/opt/ros/humble/lib/python3.10/site-packages/launch_testing/__init__.py", line 15, in + from . import tools + File "/opt/ros/humble/lib/python3.10/site-packages/launch_testing/tools/__init__.py", line 18, in + from .process import launch_process + File "/opt/ros/humble/lib/python3.10/site-packages/launch_testing/tools/process.py", line 17, in + import launch + File "/opt/ros/humble/lib/python3.10/site-packages/launch/__init__.py", line 17, in + from . import actions + File "/opt/ros/humble/lib/python3.10/site-packages/launch/actions/__init__.py", line 17, in + from .declare_launch_argument import DeclareLaunchArgument + File "/opt/ros/humble/lib/python3.10/site-packages/launch/actions/declare_launch_argument.py", line 22, in + import launch.logging + File "/opt/ros/humble/lib/python3.10/site-packages/launch/logging/__init__.py", line 32, in + from ..frontend import expose_substitution + File "/opt/ros/humble/lib/python3.10/site-packages/launch/frontend/__init__.py", line 17, in + from . import type_utils + File "/opt/ros/humble/lib/python3.10/site-packages/launch/frontend/type_utils.py", line 22, in + from .entity import Entity + File "/opt/ros/humble/lib/python3.10/site-packages/launch/frontend/entity.py", line 22, in + from launch.utilities.type_utils import AllowedTypesType + File "/opt/ros/humble/lib/python3.10/site-packages/launch/utilities/type_utils.py", line 29, in + import yaml +ModuleNotFoundError: No module named 'yaml' +make[3]: *** [modules/python/test/CMakeFiles/visp_python_bindings_test.dir/build.make:71: modules/python/test/CMakeFiles/visp_python_bindings_test] Error 1 +make[2]: *** [CMakeFiles/Makefile2:2278: modules/python/test/CMakeFiles/visp_python_bindings_test.dir/all] Error 2 +make[1]: *** [CMakeFiles/Makefile2:2285: modules/python/test/CMakeFiles/visp_python_bindings_test.dir/rule] Error 2 +make: *** [Makefile:702: visp_python_bindings_test] Error 2 +(venv) $ +\endverbatim + +The work arround consists in uninstalling `python3-pytest`. + */ From c6536e41ae8401584be0064a1d0d6ad3fd361d60 Mon Sep 17 00:00:00 2001 From: Fabien Spindler Date: Fri, 19 Apr 2024 17:37:44 +0200 Subject: [PATCH 2/2] Update doc --- doc/tutorial/python/tutorial-install-python-bindings.dox | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/doc/tutorial/python/tutorial-install-python-bindings.dox b/doc/tutorial/python/tutorial-install-python-bindings.dox index 9d31e35787..36f1006b4c 100644 --- a/doc/tutorial/python/tutorial-install-python-bindings.dox +++ b/doc/tutorial/python/tutorial-install-python-bindings.dox @@ -833,7 +833,7 @@ This error may also happen when generating the Python stubs (after the bindings \subsubsection py_bindings_known_errors_test When building the tests -The following error may occur when building Python tests on Ubuntu 22.04 when ROS-2 humble is installed: +The following error may occur when building Python tests on Ubuntu 22.04 when ros-2 humble is installed: \verbatim (venv) $ cd $VISP_WS/visp-build-bindings @@ -961,6 +961,8 @@ make: *** [Makefile:702: visp_python_bindings_test] Error 2 (venv) $ \endverbatim -The work arround consists in uninstalling `python3-pytest`. +The work arround consists in uninstalling `python3-pytest` system package. + +\warning Removing `python3-pytest` could break the ros-2 installation, as `python3-pytest` is a dependency of some humble ros-2 packages. */