Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add stubs for "click-log" package #13207

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions stubs/click-log/METADATA.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
version = "0.4.*"
requires = ["click>=8.0.0"]
upstream_repository = "https://github.com/click-contrib/click-log"
4 changes: 4 additions & 0 deletions stubs/click-log/click_log/__init__.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
from .core import ClickHandler as ClickHandler, ColorFormatter as ColorFormatter, basic_config as basic_config
from .options import simple_verbosity_option as simple_verbosity_option

__version__: str
15 changes: 15 additions & 0 deletions stubs/click-log/click_log/core.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
import logging

LOGGER_KEY: str
DEFAULT_LEVEL: int
PY2: bool
text_type: type

class ColorFormatter(logging.Formatter):
colors: dict[str, dict[str, str]]
def format(self, record: logging.LogRecord) -> str: ...

class ClickHandler(logging.Handler):
def emit(self, record: logging.LogRecord) -> None: ...

def basic_config(logger: logging.Logger | str | None = None) -> None: ...
12 changes: 12 additions & 0 deletions stubs/click-log/click_log/options.pyi
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
import logging
import typing as t
from typing_extensions import TypeAlias

import click

_AnyCallable: TypeAlias = t.Callable[..., t.Any]
_FC = t.TypeVar("_FC", bound=_AnyCallable | click.Command)

def simple_verbosity_option(
logger: logging.Logger | str | None = None, *names: str, **kwargs: t.Any
) -> t.Callable[[_FC], _FC]: ...
Loading