Skip to content
Snippets Groups Projects
Commit be8f1a55 authored by David Douard's avatar David Douard
Browse files

Adapt cli declaration entrypoint to swh.core 0.3

The addition of '-p no:pytest_swh_core' in pytest.ini is needed to
prevent pytest from loading the pytest_swh_core plugin which we do not
need here and which would require some more dependencies (e.g.
requests).
parent e0b4b946
No related branches found
No related tags found
1 merge request!137Adapt cli declaration entrypoint to swh.core 0.3
This commit is part of merge request !137. Comments created here will be created in the context of that merge request.
[pytest] [pytest]
addopts = --doctest-modules addopts = --doctest-modules -p no:pytest_swh_core
norecursedirs = docs .* norecursedirs = docs .*
markers = markers =
fs: tests that involve filesystem ios fs: tests that involve filesystem ios
swh.core swh.core >= 0.3
Click Click
dulwich dulwich
...@@ -54,14 +54,14 @@ setup( ...@@ -54,14 +54,14 @@ setup(
), ),
extras_require={ extras_require={
"cli": parse_requirements("cli"), "cli": parse_requirements("cli"),
"testing": parse_requirements("test"), "testing": parse_requirements("test") + parse_requirements("cli"),
}, },
include_package_data=True, include_package_data=True,
entry_points=""" entry_points="""
[console_scripts] [console_scripts]
swh-identify=swh.model.cli:identify swh-identify=swh.model.cli:identify
[swh.cli.subcommands] [swh.cli.subcommands]
identify=swh.model.cli:identify identify=swh.model.cli
""", """,
classifiers=[ classifiers=[
"Programming Language :: Python :: 3", "Programming Language :: Python :: 3",
......
...@@ -9,6 +9,8 @@ import sys ...@@ -9,6 +9,8 @@ import sys
# WARNING: do not import unnecessary things here to keep cli startup time under # WARNING: do not import unnecessary things here to keep cli startup time under
# control # control
import click import click
from swh.core.cli import swh as swh_cli_group
CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"]) CONTEXT_SETTINGS = dict(help_option_names=["-h", "--help"])
...@@ -138,7 +140,7 @@ def identify_object(obj_type, follow_symlinks, obj): ...@@ -138,7 +140,7 @@ def identify_object(obj_type, follow_symlinks, obj):
return (obj, swhid) return (obj, swhid)
@click.command(context_settings=CONTEXT_SETTINGS) @swh_cli_group.command(context_settings=CONTEXT_SETTINGS)
@click.option( @click.option(
"--dereference/--no-dereference", "--dereference/--no-dereference",
"follow_symlinks", "follow_symlinks",
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment