Builds with ament_python broken with sphinx >= 7.0.0
oysstu opened this issue · 2 comments
The following way of obtaining a list of available commands from setup.py is broken on sphinx v7.0.0 and later.
colcon-core/colcon_core/task/python/build.py
Lines 170 to 185 in 99c0326
This occurs because the setuptools integration is deprecated:
sphinx-doc/sphinx#9595 (comment)
The end result is that ament_python continues as normal, but installs the package as an egg without the egg-info.
When building ros, the build will fail on ament_cmake_core because it cannot find ament_package. Egg modules are not imported even if the site-packages directory is in the python-path. It's possible to add something like this to make the egg import
import site
import os
site.addsitedir(os.path.split(__file__)[0])
However, there's further breakage later in the build process in cmake, as it expects template files in a certain location (and not inside the compressed egg).
Funnily enough, this actually seems to be a bug with Sphinx. I've filed a PR with them: sphinx-doc/sphinx#11418
Resolved in sphinx 7.0.1