14
0
forked from pool/python-loguru

- Add patch support-new-mypy.patch:

* Support newer mypy than upstream.

OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-loguru?expand=0&rev=33
This commit is contained in:
2025-08-01 03:57:19 +00:00
committed by Git OBS Bridge
parent e92bf0569b
commit af97aa91ab
3 changed files with 77 additions and 2 deletions

View File

@@ -1,3 +1,9 @@
-------------------------------------------------------------------
Fri Aug 1 03:56:41 UTC 2025 - Steve Kowalik <steven.kowalik@suse.com>
- Add patch support-new-mypy.patch:
* Support newer mypy than upstream.
-------------------------------------------------------------------
Wed May 7 05:28:06 UTC 2025 - Guang Yee <gyee@suse.com>

View File

@@ -22,9 +22,10 @@ Version: 0.7.3
Release: 0
Summary: Python logging component with a simple interface
License: MIT
Group: Development/Languages/Python
URL: https://github.com/Delgan/loguru
Source: https://github.com/Delgan/loguru/archive/refs/tags/%{version}.tar.gz#/loguru-%{version}.tar.gz
# PATCH-FIX-OPENSUSE Support newer mypy than upstream
Patch0: support-new-mypy.patch
BuildRequires: %{python_module colorama}
BuildRequires: %{python_module flit-core}
BuildRequires: %{python_module freezegun}
@@ -68,6 +69,6 @@ fi
%license LICENSE
%doc README.md
%{python_sitelib}/loguru
%{python_sitelib}/loguru-%{version}*-info
%{python_sitelib}/loguru-%{version}.dist-info
%changelog

68
support-new-mypy.patch Normal file
View File

@@ -0,0 +1,68 @@
Index: loguru-0.7.3/tests/conftest.py
===================================================================
--- loguru-0.7.3.orig/tests/conftest.py
+++ loguru-0.7.3/tests/conftest.py
@@ -62,7 +62,6 @@ if sys.version_info >= (3, 6):
item.additional_mypy_config += "\n".join(
[
"show_error_codes = false",
- "force_uppercase_builtins = true",
"force_union_syntax = true",
]
)
Index: loguru-0.7.3/tests/typesafety/test_logger.yml
===================================================================
--- loguru-0.7.3.orig/tests/typesafety/test_logger.yml
+++ loguru-0.7.3/tests/typesafety/test_logger.yml
@@ -205,7 +205,7 @@
level = logger.level("INFO")
reveal_type(level)
out: |
- main:4: note: Revealed type is "Tuple[builtins.str, builtins.int, builtins.str, builtins.str, fallback=loguru.Level]"
+ main:4: note: Revealed type is "tuple[builtins.str, builtins.int, builtins.str, builtins.str, fallback=loguru.Level]"
- case: level_set
main: |
@@ -214,7 +214,7 @@
level = logger.level("FOO", no=11, icon="!", color="<blue>")
reveal_type(level)
out: |
- main:4: note: Revealed type is "Tuple[builtins.str, builtins.int, builtins.str, builtins.str, fallback=loguru.Level]"
+ main:4: note: Revealed type is "tuple[builtins.str, builtins.int, builtins.str, builtins.str, fallback=loguru.Level]"
- case: level_update
main: |
@@ -223,7 +223,7 @@
level = logger.level("INFO", color="<blue>")
reveal_type(level)
out: |
- main:4: note: Revealed type is "Tuple[builtins.str, builtins.int, builtins.str, builtins.str, fallback=loguru.Level]"
+ main:4: note: Revealed type is "tuple[builtins.str, builtins.int, builtins.str, builtins.str, fallback=loguru.Level]"
- case: enable_and_disable_logger
main: |
@@ -285,9 +285,9 @@
out: |
main:2: error: No overload variant of "add" of "Logger" matches argument types "Callable[[Any], None]", "int"
main:2: note: Possible overload variants:
- main:2: note: def add(self, sink: Union[TextIO, Writable, Callable[[Message], None], Handler], *, level: Union[str, int] = ..., format: Union[str, Callable[[Record], str]] = ..., filter: Union[str, Callable[[Record], bool], Dict[Optional[str], Union[str, int, bool]], None] = ..., colorize: Optional[bool] = ..., serialize: bool = ..., backtrace: bool = ..., diagnose: bool = ..., enqueue: bool = ..., context: Union[str, BaseContext, None] = ..., catch: bool = ...) -> int
- main:2: note: def add(self, sink: Callable[[Message], Awaitable[None]], *, level: Union[str, int] = ..., format: Union[str, Callable[[Record], str]] = ..., filter: Union[str, Callable[[Record], bool], Dict[Optional[str], Union[str, int, bool]], None] = ..., colorize: Optional[bool] = ..., serialize: bool = ..., backtrace: bool = ..., diagnose: bool = ..., enqueue: bool = ..., catch: bool = ..., context: Union[str, BaseContext, None] = ..., loop: Optional[AbstractEventLoop] = ...) -> int
- main:2: note: def add(self, sink: Union[str, PathLike[str]], *, level: Union[str, int] = ..., format: Union[str, Callable[[Record], str]] = ..., filter: Union[str, Callable[[Record], bool], Dict[Optional[str], Union[str, int, bool]], None] = ..., colorize: Optional[bool] = ..., serialize: bool = ..., backtrace: bool = ..., diagnose: bool = ..., enqueue: bool = ..., context: Union[str, BaseContext, None] = ..., catch: bool = ..., rotation: Union[str, int, time, timedelta, Callable[[Message, TextIO], bool], None] = ..., retention: Union[str, int, timedelta, Callable[[List[str]], None], None] = ..., compression: Union[str, Callable[[str], None], None] = ..., delay: bool = ..., watch: bool = ..., mode: str = ..., buffering: int = ..., encoding: str = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> int
+ main:2: note: def add(self, sink: Union[TextIO, Writable, Callable[[Message], None], Handler], *, level: Union[str, int] = ..., format: Union[str, Callable[[Record], str]] = ..., filter: Union[str, Callable[[Record], bool], dict[Optional[str], Union[str, int, bool]], None] = ..., colorize: Optional[bool] = ..., serialize: bool = ..., backtrace: bool = ..., diagnose: bool = ..., enqueue: bool = ..., context: Union[str, BaseContext, None] = ..., catch: bool = ...) -> int
+ main:2: note: def add(self, sink: Callable[[Message], Awaitable[None]], *, level: Union[str, int] = ..., format: Union[str, Callable[[Record], str]] = ..., filter: Union[str, Callable[[Record], bool], dict[Optional[str], Union[str, int, bool]], None] = ..., colorize: Optional[bool] = ..., serialize: bool = ..., backtrace: bool = ..., diagnose: bool = ..., enqueue: bool = ..., catch: bool = ..., context: Union[str, BaseContext, None] = ..., loop: Optional[AbstractEventLoop] = ...) -> int
+ main:2: note: def add(self, sink: Union[str, PathLike[str]], *, level: Union[str, int] = ..., format: Union[str, Callable[[Record], str]] = ..., filter: Union[str, Callable[[Record], bool], dict[Optional[str], Union[str, int, bool]], None] = ..., colorize: Optional[bool] = ..., serialize: bool = ..., backtrace: bool = ..., diagnose: bool = ..., enqueue: bool = ..., context: Union[str, BaseContext, None] = ..., catch: bool = ..., rotation: Union[str, int, time, timedelta, Callable[[Message, TextIO], bool], None] = ..., retention: Union[str, int, timedelta, Callable[[list[str]], None], None] = ..., compression: Union[str, Callable[[str], None], None] = ..., delay: bool = ..., watch: bool = ..., mode: str = ..., buffering: int = ..., encoding: str = ..., errors: Optional[str] = ..., newline: Optional[str] = ..., closefd: bool = ..., opener: Optional[Callable[[str, int], int]] = ...) -> int
- case: invalid_logged_object_formatting
main: |
@@ -310,8 +310,8 @@
extra=[1],
)
out: |
- main:3: error: List item 0 has incompatible type "Dict[str, str]"; expected "Union[BasicHandlerConfig, FileHandlerConfig, AsyncHandlerConfig]"
+ main:3: error: List item 0 has incompatible type "dict[str, str]"; expected "Union[BasicHandlerConfig, FileHandlerConfig, AsyncHandlerConfig]"
main:4: error: Extra key "baz" for TypedDict "LevelConfig"
main:5: error: Argument "patcher" to "configure" of "Logger" has incompatible type "int"; expected "Optional[Callable[[Record], None]]"
- main:6: error: List item 0 has incompatible type "Dict[str, str]"; expected "Tuple[Optional[str], bool]"
- main:7: error: Argument "extra" to "configure" of "Logger" has incompatible type "List[int]"; expected "Optional[Dict[Any, Any]]"
+ main:6: error: List item 0 has incompatible type "dict[str, str]"; expected "tuple[Optional[str], bool]"
+ main:7: error: Argument "extra" to "configure" of "Logger" has incompatible type "list[int]"; expected "Optional[dict[Any, Any]]"