diff --git a/pytest.ini b/pytest.ini --- a/pytest.ini +++ b/pytest.ini @@ -1,5 +1,5 @@ [pytest] -addopts = --doctest-modules +addopts = --doctest-modules -p no:pytest_swh_core norecursedirs = docs .* markers = fs: tests that involve filesystem ios diff --git a/requirements-cli.txt b/requirements-cli.txt --- a/requirements-cli.txt +++ b/requirements-cli.txt @@ -1,3 +1,3 @@ -swh.core +swh.core >= 0.3 Click dulwich diff --git a/setup.py b/setup.py --- a/setup.py +++ b/setup.py @@ -54,14 +54,14 @@ ), extras_require={ "cli": parse_requirements("cli"), - "testing": parse_requirements("test"), + "testing": parse_requirements("test") + parse_requirements("cli"), }, include_package_data=True, entry_points=""" [console_scripts] swh-identify=swh.model.cli:identify [swh.cli.subcommands] - identify=swh.model.cli:identify + identify=swh.model.cli """, classifiers=[ "Programming Language :: Python :: 3", diff --git a/swh/model/cli.py b/swh/model/cli.py --- a/swh/model/cli.py +++ b/swh/model/cli.py @@ -9,6 +9,8 @@ # WARNING: do not import unnecessary things here to keep cli startup time under # control import click +from swh.core.cli import swh as swh_cli_group + CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"]) @@ -138,7 +140,7 @@ return (obj, swhid) -@click.command(context_settings=CONTEXT_SETTINGS) +@swh_cli_group.command(context_settings=CONTEXT_SETTINGS) @click.option( "--dereference/--no-dereference", "follow_symlinks",