Page MenuHomeSoftware Heritage

D5466.id19534.diff
No OneTemporary

D5466.id19534.diff

diff --git a/swh/model/cli.py b/swh/model/cli.py
--- a/swh/model/cli.py
+++ b/swh/model/cli.py
@@ -9,7 +9,11 @@
# WARNING: do not import unnecessary things here to keep cli startup time under
# control
-import click
+try:
+ import click
+except ImportError:
+ print("Cannot run swh-identify; python3-click is installed.", file=sys.stderr)
+ exit(1)
try:
from swh.core.cli import swh as swh_cli_group
@@ -101,7 +105,12 @@
def swhid_of_git_repo(path) -> CoreSWHID:
- import dulwich.repo
+ try:
+ import dulwich.repo
+ except ImportError:
+ raise click.ClickException(
+ "Cannot compute snapshot identifier; python3-dulwich is not installed."
+ )
from swh.model import hashutil
from swh.model.identifiers import snapshot_identifier

File Metadata

Mime Type
text/plain
Expires
Nov 5 2024, 6:42 AM (8 w, 2 d ago)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
3225457

Event Timeline