Skip to content

cli: Don't crash when subcommands fail importing

This is an issue when swh.model is installed but not dulwich: swh.model.cli imports dulwich unconditionally, so /usr/bin/swh fails for all subcommands instead of just ignoring the issue.

Test Plan

 python3 -m venv cli-fail
 . ./cli-fail/bin/activate
 pip install swh.core swh.model
 ./cli-fail/bin/swh

Doesn't fail with ModuleNotFoundError: No module named 'dulwich'


Migrated from D2225 (view on Phabricator)

Merge request reports