Add strict mode to pyright (#315)
* Add strict mode to pyright * Apply UP rule * fix readme * More correct * Leave wrong Context for now * Add strict mode to pyright * Apply UP rule * fix readme * fix * ignore
This commit is contained in:
parent
5a54d82459
commit
ae77772ea8
2 changed files with 194 additions and 133 deletions
|
|
@ -80,7 +80,7 @@ class FuncMetadata(BaseModel):
|
|||
dicts (JSON objects) as JSON strings, which can be pre-parsed here.
|
||||
"""
|
||||
new_data = data.copy() # Shallow copy
|
||||
for field_name, field_info in self.arg_model.model_fields.items():
|
||||
for field_name, _field_info in self.arg_model.model_fields.items():
|
||||
if field_name not in data.keys():
|
||||
continue
|
||||
if isinstance(data[field_name], str):
|
||||
|
|
@ -177,7 +177,9 @@ def func_metadata(
|
|||
|
||||
|
||||
def _get_typed_annotation(annotation: Any, globalns: dict[str, Any]) -> Any:
|
||||
def try_eval_type(value, globalns, localns):
|
||||
def try_eval_type(
|
||||
value: Any, globalns: dict[str, Any], localns: dict[str, Any]
|
||||
) -> tuple[Any, bool]:
|
||||
try:
|
||||
return eval_type_backport(value, globalns, localns), True
|
||||
except NameError:
|
||||
|
|
|
|||
|
|
@ -24,7 +24,7 @@ def configure_logging(
|
|||
Args:
|
||||
level: the log level to use
|
||||
"""
|
||||
handlers = []
|
||||
handlers: list[logging.Handler] = []
|
||||
try:
|
||||
from rich.console import Console
|
||||
from rich.logging import RichHandler
|
||||
|
|
|
|||
Loading…
Reference in a new issue