catkin icon indicating copy to clipboard operation
catkin copied to clipboard

Avoid distutils-related build time spam on Python 3.11

Open mikepurvis opened this issue 10 months ago • 1 comments

Without this change, Python 3.11 platforms get this on every build— not just of catkin itself, but every package that uses it:

/home/mikepurvis/roslib_ws/install/share/catkin/cmake/interrogate_setup_dot_py.py:43: DeprecationWarning: The distutils package is deprecated and slated for removal in Python 3.12. Use setuptools or check PEP 632 for potential alternatives
  import distutils.core

This has been discussed previously in https://github.com/ros/catkin/issues/1164#issuecomment-1039650945, but I'm hopeful that this change will resolve the issue for Python 3.11+ users while allowing any remaining distutils packages to continue functioning.

Note that this does not address the other deprecation warning related to catkin invoking setup.py directly. There was some discussion of that in https://github.com/ros/catkin/issues/1162, but it will definitely be a separate PR, attempting to move cmake/templates/python_distutils_install.sh.in to a pypi/build workflow.

mikepurvis avatar Apr 10 '24 17:04 mikepurvis

Building our larger workspace with this change has revealed that it definitely still breaks with ROS Python packages using distutils— I'll modify the patch to conditionally import distutils in the case where the package's setup.py actually uses it.

mikepurvis avatar Apr 11 '24 13:04 mikepurvis