forked from pool/python-loguru
		
	* Support newer mypy than upstream. OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-loguru?expand=0&rev=33
		
			
				
	
	
		
			69 lines
		
	
	
		
			6.8 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
			
		
		
	
	
			69 lines
		
	
	
		
			6.8 KiB
		
	
	
	
		
			Diff
		
	
	
	
	
	
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]]"
 |