Skip to content

Commit 2c27933

Browse files
authored
Add stubs for "click-log" package (#13207)
1 parent 57d2e04 commit 2c27933

File tree

4 files changed

+34
-0
lines changed

4 files changed

+34
-0
lines changed

stubs/click-log/METADATA.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
version = "0.4.*"
2+
requires = ["click>=8.0.0"]
3+
upstream_repository = "https://github.com/click-contrib/click-log"
Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
from .core import ClickHandler as ClickHandler, ColorFormatter as ColorFormatter, basic_config as basic_config
2+
from .options import simple_verbosity_option as simple_verbosity_option
3+
4+
__version__: str

stubs/click-log/click_log/core.pyi

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import logging
2+
3+
LOGGER_KEY: str
4+
DEFAULT_LEVEL: int
5+
PY2: bool
6+
text_type: type
7+
8+
class ColorFormatter(logging.Formatter):
9+
colors: dict[str, dict[str, str]]
10+
def format(self, record: logging.LogRecord) -> str: ...
11+
12+
class ClickHandler(logging.Handler):
13+
def emit(self, record: logging.LogRecord) -> None: ...
14+
15+
def basic_config(logger: logging.Logger | str | None = None) -> None: ...
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
import logging
2+
import typing as t
3+
from typing_extensions import TypeAlias
4+
5+
import click
6+
7+
_AnyCallable: TypeAlias = t.Callable[..., t.Any]
8+
_FC = t.TypeVar("_FC", bound=_AnyCallable | click.Command)
9+
10+
def simple_verbosity_option(
11+
logger: logging.Logger | str | None = None, *names: str, **kwargs: t.Any
12+
) -> t.Callable[[_FC], _FC]: ...

0 commit comments

Comments
 (0)