Skip to content

Commit

Permalink
feat: remove click-completion
Browse files Browse the repository at this point in the history
Shell completion is now supported by click itself and the extra package is dead.

click-contrib/click-completion#37
click-contrib/click-completion#41

It is still not trivial to use because it needs to be enabled for the shell.
And maybe is and always was impossible for these example .py files because they are not real commands anyway.

https://click.palletsprojects.com/en/8.1.x/shell-completion/
  • Loading branch information
tilsche committed Jun 1, 2023
1 parent 253fbfa commit 05eb744
Show file tree
Hide file tree
Showing 8 changed files with 0 additions and 21 deletions.
2 changes: 0 additions & 2 deletions examples/metricq_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,6 @@

import aiomonitor # type: ignore
import click
import click_completion # type: ignore
import click_log # type: ignore

import metricq
Expand All @@ -55,7 +54,6 @@
logger.handlers[0].formatter = logging.Formatter(
fmt="%(asctime)s [%(levelname)-8s] [%(name)-20s] %(message)s"
)
click_completion.init()


async def run(server: str, token: str) -> None:
Expand Down
3 changes: 0 additions & 3 deletions examples/metricq_get_history.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,6 @@
from datetime import timedelta

import click
import click_completion # type: ignore
import click_log # type: ignore

import metricq
Expand All @@ -48,8 +47,6 @@
fmt="%(asctime)s [%(levelname)-8s] [%(name)-20s] %(message)s"
)

click_completion.init()


async def aget_history(
server: str, token: str, metric: str, list_metrics: bool, list_metadata: bool
Expand Down
3 changes: 0 additions & 3 deletions examples/metricq_get_history_raw.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from datetime import timedelta

import click
import click_completion # type: ignore
import click_log # type: ignore

import metricq
Expand All @@ -48,8 +47,6 @@
fmt="%(asctime)s [%(levelname)-8s] [%(name)-20s] %(message)s"
)

click_completion.init()


async def aget_history(server: str, token: str, metric: str) -> None:
client = metricq.HistoryClient(token=token, url=server)
Expand Down
3 changes: 0 additions & 3 deletions examples/metricq_pandas.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from datetime import timedelta

import click
import click_completion # type: ignore
import click_log # type: ignore

import metricq
Expand All @@ -48,8 +47,6 @@
fmt="%(asctime)s [%(levelname)-8s] [%(name)-20s] %(message)s"
)

click_completion.init()


async def aget_history(server: str, token: str, metric: str) -> None:
async with PandasHistoryClient(token=token, url=server) as client:
Expand Down
3 changes: 0 additions & 3 deletions examples/metricq_sink.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@
from typing import Any

import click
import click_completion # type: ignore
import click_log # type: ignore

import metricq
Expand All @@ -46,8 +45,6 @@
fmt="%(asctime)s [%(levelname)-8s] [%(name)-20s] %(message)s"
)

click_completion.init()


# To implement a MetricQ Sink, subclass metricq.Sink
class DummySink(metricq.Sink):
Expand Down
3 changes: 0 additions & 3 deletions examples/metricq_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
from typing import Any

import click
import click_completion # type: ignore
import click_log # type: ignore

import metricq
Expand All @@ -46,8 +45,6 @@
fmt="%(asctime)s [%(levelname)-8s] [%(name)-20s] %(message)s"
)

click_completion.init()


class DummySource(metricq.IntervalSource):
def __init__(self, *args: Any, **kwargs: Any):
Expand Down
3 changes: 0 additions & 3 deletions examples/metricq_synchronous_source.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,6 @@
import time

import click
import click_completion # type: ignore
import click_log # type: ignore

from metricq import SynchronousSource, Timestamp, get_logger
Expand All @@ -47,8 +46,6 @@
fmt="%(asctime)s [%(levelname)-8s] [%(name)-20s] %(message)s"
)

click_completion.init()


@click.command()
@click.option("--server", default="amqp://localhost/")
Expand Down
1 change: 0 additions & 1 deletion setup.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@ examples =
aiomonitor-ng
click
click-log
click-completion
lint =
black[jupyter] ~= 23.1.0
flake8
Expand Down

0 comments on commit 05eb744

Please sign in to comment.