Page Menu
Home
Software Heritage
Search
Configure Global Search
Log In
Files
F7066367
D5460.id19505.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Subscribers
None
D5460.id19505.diff
View Options
diff --git a/swh/model/cli.py b/swh/model/cli.py
--- a/swh/model/cli.py
+++ b/swh/model/cli.py
@@ -11,7 +11,12 @@
# control
import click
-from swh.core.cli import swh as swh_cli_group
+try:
+ from swh.core.cli import swh as swh_cli_group
+except ImportError:
+ # stub so that swh-identify can be used when swh-core isn't installed
+ swh_cli_group = click # type: ignore
+
from swh.model.identifiers import CoreSWHID, ObjectType
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
diff --git a/tox.ini b/tox.ini
--- a/tox.ini
+++ b/tox.ini
@@ -1,5 +1,5 @@
[tox]
-envlist=black,flake8,mypy,py3
+envlist=black,flake8,mypy,py3,identify
[testenv]
extras =
@@ -12,6 +12,15 @@
{envsitepackagesdir}/swh/model \
--cov-branch {posargs}
+[testenv:identify]
+# no 'extras = testing', as it would install swh-core;
+# and this test is designed to check 'swh-identify' does not depend on swh-core.
+extras =
+deps =
+ -r requirements-test.txt
+commands =
+ pytest {envsitepackagesdir}/swh/model/tests/test_cli.py
+
[testenv:black]
skip_install = true
deps =
File Metadata
Details
Attached
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
3223798
Attached To
D5460: Remove accidental dependency of 'swh-identify' on swh-core
Event Timeline
Log In to Comment