vcstool is broken on Python 3.13
e.g.:
❯ vcs import --input https://raw.githubusercontent.com/ros2/ros2/jazzy/ros2.repos src
Traceback (most recent call last):
File "/opt/homebrew/bin/vcs", line 5, in <module>
from vcstool.commands.vcs import main
File "/opt/homebrew/lib/python3.13/site-packages/vcstool/commands/vcs.py", line 3, in <module>
from vcstool.commands.help import get_entrypoint
File "/opt/homebrew/lib/python3.13/site-packages/vcstool/commands/help.py", line 4, in <module>
from pkg_resources import load_entry_point
File "/opt/homebrew/lib/python3.13/site-packages/pkg_resources/__init__.py", line 2172, in <module>
register_finder(pkgutil.ImpImporter, find_on_path)
^^^^^^^^^^^^^^^^^^^
AttributeError: module 'pkgutil' has no attribute 'ImpImporter'. Did you mean: 'zipimporter'?
it seems vcstool it is using deprecated pkg_resources (related: #269).
Solution:
make the following changes in vcstool/commands/help.py:
- change
from pkg_resources import load_entry_pointtofrom importlib.metadata import entry_points - add following helper function:
def load_vcs_command(commands):
entries = entry_points()
vcs_entry_point = next(
ep for ep in entries
if ep.group == 'console_scripts' and ep.name == 'vcs-' + commands[0]
)
return vcs_entry_point.load()
- in function
get_entrypoint(command), replacereturn load_entry_point(...withreturn load_vcs_command(commands)
@dirk-thomas, is there a plan to create an official release to replace the current 0.3.0 so that the deprecation doesn't lead to a 0.3.0 failure on the announced 2025-11-30?
Thank you.
@dirk-thomas, is there a plan to create an official release to replace the current 0.3.0 so that the deprecation doesn't lead to a 0.3.0 failure on the announced 2025-11-30?
Thank you.
See https://github.com/dirk-thomas/vcstool/issues/242 . TL;DR: A mantained friendly fork is available at https://github.com/ros-infrastructure/vcs2l .