jw-pkg/src/python/jw/pkg/cmds/CmdPosix.py
Jan Lindemann 5d1ba6e15a
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>
2026-06-01 14:34:25 +02:00

24 lines
596 B
Python

from __future__ import annotations
from typing import TYPE_CHECKING
from .Cmd import Cmd, Parent
if TYPE_CHECKING:
from argparse import ArgumentParser
class CmdPosix(Cmd): # export
def __init__(self, parent: Parent) -> None:
super().__init__(
parent,
'posix',
help = (
'Perform various operations on a distro through its '
'POSIX utility interface'
),
)
self.load_subcommands()
def add_arguments(self, parser: ArgumentParser) -> None:
super().add_arguments(parser)