Page MenuHomeSoftware Heritage

cli: Don't crash when subcommands fail importing

Authored by olasd on Nov 6 2019, 2:47 PM.



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

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

Diff Detail

rDCORE Foundations and core functionalities
Automatic diff as part of commit; lint not applicable.
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

olasd created this revision.Nov 6 2019, 2:47 PM
olasd edited the test plan for this revision. (Show Details)Nov 6 2019, 2:48 PM
ardumont added inline comments.

.warning or else you will have a warning about it

ardumont accepted this revision.Nov 6 2019, 3:00 PM
This revision is now accepted and ready to land.Nov 6 2019, 3:00 PM
olasd updated this revision to Diff 7671.Nov 6 2019, 3:38 PM
olasd marked an inline comment as done.


This revision was automatically updated to reflect the committed changes.