pyproject.toml: Enforce import annotations style
Add new ruff rules and fix their fallout:
future-annotations = true
select = [
"TC", # type-checking import placement rules
"FA", # future annotations rules
]
This comprises:
- Streamline imports and exports in cmds.xxx.Cmd
- Import base class as "Base"
- Export types Cmd and Parent via __all__
- Move all types imported only for annotation below TYPE_CHECKING
- Use "from __future__ import annotations" all over the place
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
7a65a7b5e1
commit
5d1ba6e15a
77 changed files with 382 additions and 196 deletions
|
|
@ -3,6 +3,8 @@ from __future__ import annotations
|
|||
from typing import TYPE_CHECKING
|
||||
|
||||
import paramiko # type: ignore[import-untyped] # error: Library stubs not installed for "paramiko"
|
||||
import paramiko.agent # type: ignore[import-untyped]
|
||||
import paramiko.SCPClient # type: ignore[import-untyped]
|
||||
|
||||
from ...base import Result
|
||||
from ...log import ERR, log
|
||||
|
|
@ -12,9 +14,6 @@ from .util import join_cmd
|
|||
if TYPE_CHECKING:
|
||||
from typing import Any
|
||||
|
||||
import paramiko.agent # type: ignore[import-untyped]
|
||||
import paramiko.SCPClient # type: ignore[import-untyped]
|
||||
|
||||
class Paramiko(Base):
|
||||
|
||||
def __init__(self, uri, *args, **kwargs) -> None:
|
||||
|
|
|
|||
Loading…
Reference in a new issue