diff --git a/rsocket/cli/command.py b/rsocket/cli/command.py index 731df7da..0221c2ce 100644 --- a/rsocket/cli/command.py +++ b/rsocket/cli/command.py @@ -1,13 +1,19 @@ import asyncio import logging import ssl +import sys from contextlib import asynccontextmanager from dataclasses import dataclass from enum import Enum, unique from importlib.metadata import version as get_version from typing import Optional, Type, Collection, List, Callable -import asyncclick as click +try: + import asyncclick as click +except ImportError: + print("This command requires the CLI extra.") + print("Install with: pip install rsocket[cli]") + sys.exit(1) from rsocket.awaitable.awaitable_rsocket import AwaitableRSocket from rsocket.extensions.helpers import route, composite, authenticate_simple, authenticate_bearer diff --git a/setup.cfg b/setup.cfg index 3a579613..440915e4 100644 --- a/setup.cfg +++ b/setup.cfg @@ -70,7 +70,7 @@ channels = asyncwebsockets = asyncwebsockets>=0.9.4 [options.entry_points] -cli.console_scripts = +console_scripts = rsocket-py = rsocket.cli.command:command [tool:pytest]