Register as a Datasette plugin too, refs #4

This commit is contained in:
Simon Willison 2022-11-21 21:33:02 -08:00
commit 02cf4c0cf2
2 changed files with 12 additions and 4 deletions

8
dclient/plugin.py Normal file
View file

@ -0,0 +1,8 @@
from datasette import hookimpl
@hookimpl
def register_commands(cli):
from .cli import cli as dclient_cli
cli.add_command(dclient_cli, name="client")

View file

@ -27,10 +27,10 @@ setup(
license="Apache License, Version 2.0",
version=VERSION,
packages=["dclient"],
entry_points="""
[console_scripts]
dclient=dclient.cli:cli
""",
entry_points={
"datasette": ["client = dclient.plugin"],
"console_scripts": ["dclient = dclient.cli:cli"],
},
install_requires=["click", "httpx", "appdirs"],
extras_require={"test": ["pytest", "pytest-httpx", "cogapp", "pytest-mock"]},
python_requires=">=3.7",