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
|
|
@ -2,15 +2,15 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ..CmdBase import CmdBase
|
||||
from ..App import App as Parent
|
||||
from ..CmdBase import CmdBase as Base
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..App import App
|
||||
from ..lib.Distro import Distro
|
||||
|
||||
class Cmd(CmdBase): # export
|
||||
class Cmd(Base): # export
|
||||
|
||||
def __init__(self, parent: App | CmdBase, name: str, help: str) -> None:
|
||||
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||
super().__init__(parent, name, help)
|
||||
|
||||
async def _run(self, args):
|
||||
|
|
@ -20,3 +20,5 @@ class Cmd(CmdBase): # export
|
|||
@property
|
||||
def distro(self) -> Distro:
|
||||
return self.app.distro
|
||||
|
||||
__all__ = ['Parent', 'Cmd']
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
from argparse import ArgumentParser
|
||||
from __future__ import annotations
|
||||
|
||||
from ..App import App
|
||||
from .Cmd import Cmd as CmdBase
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
class CmdPkg(CmdBase): # export
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
def __init__(self, parent: App) -> None:
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser
|
||||
|
||||
class CmdPkg(Cmd): # export
|
||||
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(parent, 'pkg', help = 'System package manager wrapper')
|
||||
self.load_subcommands()
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
from argparse import ArgumentParser
|
||||
from __future__ import annotations
|
||||
|
||||
from ..App import App
|
||||
from .Cmd import Cmd as CmdBase
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
class CmdPlatform(CmdBase): # export
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
def __init__(self, parent: App) -> None:
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser
|
||||
|
||||
class CmdPlatform(Cmd): # export
|
||||
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(
|
||||
parent, 'platform', help = 'Miscellaneous platform-related comamnds'
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
from argparse import ArgumentParser
|
||||
from __future__ import annotations
|
||||
|
||||
from ..App import App
|
||||
from .Cmd import Cmd as CmdBase
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
class CmdPosix(CmdBase): # export
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
def __init__(self, parent: App) -> None:
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser
|
||||
|
||||
class CmdPosix(Cmd): # export
|
||||
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(
|
||||
parent,
|
||||
'posix',
|
||||
|
|
|
|||
|
|
@ -1,13 +1,17 @@
|
|||
from __future__ import annotations
|
||||
|
||||
import sys
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ..App import App
|
||||
from .Cmd import Cmd as CmdBase
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
class CmdProjects(CmdBase): # export
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser
|
||||
|
||||
def __init__(self, parent: App) -> None:
|
||||
class CmdProjects(Cmd): # export
|
||||
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(
|
||||
parent,
|
||||
'projects',
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
from argparse import ArgumentParser
|
||||
from __future__ import annotations
|
||||
|
||||
from ..App import App
|
||||
from .Cmd import Cmd as CmdBase
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
class CmdSecrets(CmdBase): # export
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
def __init__(self, parent: App) -> None:
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser
|
||||
|
||||
class CmdSecrets(Cmd): # export
|
||||
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(parent, 'secrets', help = 'Manage package secrets')
|
||||
self.load_subcommands()
|
||||
|
||||
|
|
|
|||
|
|
@ -2,12 +2,19 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..CmdPkg import CmdPkg
|
||||
from ...CmdBase import CmdBase as Base
|
||||
from ..CmdPkg import CmdPkg as Parent
|
||||
|
||||
from ..Cmd import Cmd as Base
|
||||
if TYPE_CHECKING:
|
||||
from ...lib.Distro import Distro
|
||||
|
||||
class Cmd(Base): # export
|
||||
|
||||
def __init__(self, parent: CmdPkg, name: str, help: str) -> None:
|
||||
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||
super().__init__(parent, name, help)
|
||||
|
||||
@property
|
||||
def distro(self) -> Distro:
|
||||
return self.app.distro
|
||||
|
||||
__all__ = ['Parent', 'Cmd']
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ..CmdPkg import CmdPkg
|
||||
from .Cmd import Cmd
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdDelete(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdPkg) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(parent, 'delete', help = 'Delete packages by name')
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ..CmdPkg import CmdPkg
|
||||
from .Cmd import Cmd
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdDup(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdPkg) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(parent, 'dup', help = 'Upgrade distribution')
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ..CmdPkg import CmdPkg
|
||||
from .Cmd import Cmd
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdInstall(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdPkg) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(
|
||||
parent,
|
||||
'install',
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ..CmdPkg import CmdPkg
|
||||
from .NamedPkgsCmd import NamedPkgsCmd as Base
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
class CmdLs(Base): # export
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
def __init__(self, parent: CmdPkg) -> None:
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdLs(Cmd): # export
|
||||
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(parent, 'ls', help = 'List package contents')
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ..CmdPkg import CmdPkg
|
||||
from .NamedPkgsCmd import NamedPkgsCmd as Base
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
class CmdMeta(Base): # export
|
||||
from .NamedPkgsCmd import NamedPkgsCmd, Parent
|
||||
|
||||
def __init__(self, parent: CmdPkg) -> None:
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdMeta(NamedPkgsCmd): # export
|
||||
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(parent, 'meta', help = 'List package metadata')
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ..CmdPkg import CmdPkg
|
||||
from .Cmd import Cmd
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdRebootRequired(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdPkg) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(
|
||||
parent,
|
||||
'reboot-required',
|
||||
|
|
|
|||
|
|
@ -1,11 +1,15 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ..CmdPkg import CmdPkg
|
||||
from .Cmd import Cmd
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdRefresh(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdPkg) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(
|
||||
parent,
|
||||
'refresh',
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ...lib.PackageFilter import PackageFilterString
|
||||
from ..CmdPkg import CmdPkg
|
||||
from .Cmd import Cmd
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdSelect(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdPkg) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(parent, 'select', help = 'Select packages by filter')
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
from argparse import ArgumentParser
|
||||
from __future__ import annotations
|
||||
|
||||
from ..CmdPkg import CmdPkg as Parent
|
||||
from .Cmd import Cmd as Base
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
class NamedPkgsCmd(Base): # export
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser
|
||||
|
||||
class NamedPkgsCmd(Cmd): # export
|
||||
|
||||
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||
super().__init__(parent, name, help)
|
||||
|
|
@ -11,3 +15,5 @@ class NamedPkgsCmd(Base): # export
|
|||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
super().add_arguments(parser)
|
||||
parser.add_argument('names', nargs = '*', help = 'Package names')
|
||||
|
||||
__all__ = ['NamedPkgsCmd', 'Parent']
|
||||
|
|
|
|||
|
|
@ -1,13 +1,11 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..CmdPlatform import CmdPlatform
|
||||
|
||||
from ..Cmd import Cmd as Base
|
||||
from ...CmdBase import CmdBase as Base
|
||||
from ..CmdPlatform import CmdPlatform as Parent
|
||||
|
||||
class Cmd(Base): # export
|
||||
|
||||
def __init__(self, parent: CmdPlatform, name: str, help: str) -> None:
|
||||
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||
super().__init__(parent, name, help)
|
||||
|
||||
__all__ = ['Parent', 'Cmd']
|
||||
|
|
|
|||
|
|
@ -1,12 +1,16 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ...lib.Distro import Distro
|
||||
from ..Cmd import Cmd
|
||||
from ..CmdPlatform import CmdPlatform
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdInfo(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdPlatform) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(
|
||||
parent, 'info', help = 'Retrieve information about target platform'
|
||||
)
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ...CmdBase import CmdBase
|
||||
from ...CmdBase import CmdBase as Base
|
||||
from ..CmdPosix import CmdPosix as Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ..CmdPosix import CmdPosix as Parent
|
||||
from argparse import ArgumentParser
|
||||
|
||||
class Cmd(CmdBase): # export
|
||||
class Cmd(Base): # export
|
||||
|
||||
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||
super().__init__(parent, name, help)
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
super().add_arguments(parser)
|
||||
|
||||
__all__ = ['Parent', 'Cmd']
|
||||
|
|
|
|||
|
|
@ -3,16 +3,14 @@ from __future__ import annotations
|
|||
from typing import TYPE_CHECKING
|
||||
|
||||
from ...lib.util import copy
|
||||
from .Cmd import Cmd
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
from ..CmdPosix import CmdPosix
|
||||
|
||||
class CmdCopy(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdPosix) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(parent, 'copy', help = 'Copy files')
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
|
|
|
|||
|
|
@ -1,9 +1,13 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ..CmdPosix import CmdPosix as Parent
|
||||
from .Cmd import Cmd as Base
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
class CmdTar(Base): # export
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdTar(Cmd): # export
|
||||
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(parent, 'tar', help = 'Handle tar archives')
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
from argparse import ArgumentParser
|
||||
from collections.abc import AsyncIterator
|
||||
from contextlib import asynccontextmanager
|
||||
from __future__ import annotations
|
||||
|
||||
from ....CmdBase import CmdBase
|
||||
from contextlib import asynccontextmanager
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ....CmdBase import CmdBase as Base
|
||||
from ....lib.FileContext import FileContext
|
||||
from ....lib.ProcFilterGpg import ProcFilterGpg
|
||||
from ....lib.TarIo import TarIo
|
||||
from ..CmdTar import CmdTar as Parent
|
||||
|
||||
class Cmd(CmdBase): # export
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser
|
||||
from collections.abc import AsyncIterator
|
||||
|
||||
class Cmd(Base): # export
|
||||
|
||||
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||
super().__init__(parent, name, help)
|
||||
|
|
@ -27,3 +32,5 @@ class Cmd(CmdBase): # export
|
|||
parser.add_argument(
|
||||
'-f', '--archive-path', required = True, help = 'Archive path'
|
||||
)
|
||||
|
||||
__all__ = ['Parent', 'Cmd']
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
from ....lib.log import DEBUG, log
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdExtract(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,14 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
from .lib.pkg_relations import VersionSyntax
|
||||
from .lib.pkg_relations import pkg_relations as pkg_relations_list
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class BaseCmdPkgRelations(Cmd):
|
||||
|
||||
def pkg_relations(self, rel_type: str, args: Namespace) -> str:
|
||||
|
|
@ -130,3 +135,5 @@ class BaseCmdPkgRelations(Cmd):
|
|||
|
||||
async def _run(self, args: Namespace) -> None:
|
||||
return self.print_pkg_relations(self.relation, args)
|
||||
|
||||
__all__ = ['Parent', 'BaseCmdPkgRelations']
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ...CmdBase import CmdBase
|
||||
from ...CmdBase import CmdBase as Base
|
||||
from ..CmdProjects import CmdProjects as Parent
|
||||
|
||||
class Cmd(CmdBase): # export
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser
|
||||
|
||||
class Cmd(Base): # export
|
||||
|
||||
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||
super().__init__(parent, name, help)
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
super().add_arguments(parser)
|
||||
|
||||
__all__ = ['Parent', 'Cmd']
|
||||
|
|
|
|||
|
|
@ -1,14 +1,18 @@
|
|||
from __future__ import annotations
|
||||
import datetime
|
||||
import os
|
||||
import re
|
||||
|
||||
from argparse import ArgumentParser, Namespace
|
||||
from functools import lru_cache
|
||||
|
||||
from ...App import Scope
|
||||
from ...lib.log import DEBUG, ERR, NOTICE, log
|
||||
from ...lib.util import get_profile_env, pretty_cmd
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdBuild(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,14 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from argparse import ArgumentParser, Namespace
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ...lib.base import InputMode
|
||||
from ...lib.log import NOTICE, log
|
||||
from .Cmd import Cmd, Parent
|
||||
from ...lib.base import Result
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ...lib.base import Result
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdCanonicalizeRemotes(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ...App import Scope
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdCflags(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,11 @@
|
|||
from __future__ import annotations
|
||||
import sys
|
||||
|
||||
from argparse import ArgumentParser
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser
|
||||
|
||||
class CmdCheck(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdCommands(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
from .lib.templates import tmpl_render
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdCreatePkgConfig(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ...App import Scope
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdExepath(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,11 +1,14 @@
|
|||
from __future__ import annotations
|
||||
import os
|
||||
import re
|
||||
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
from ...lib.log import DEBUG, log
|
||||
from ...lib.Uri import Uri
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdGetAuthInfo(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdGetval(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdHtdocsDir(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ...App import Scope
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdLdflags(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ...App import Scope
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdLdlibpath(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdLibname(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,12 +1,15 @@
|
|||
from __future__ import annotations
|
||||
import os
|
||||
import re
|
||||
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
from ...lib.log import DEBUG, log
|
||||
from ...lib.Uri import Uri
|
||||
from ...lib.util import get_password, get_username, run_curl_into
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdListRepos(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
from __future__ import annotations
|
||||
import re
|
||||
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
from ...lib.log import DEBUG, log
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdModules(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ...App import Scope
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdPath(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base
|
||||
from .Cmd import Parent
|
||||
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base, Parent
|
||||
|
||||
class CmdPkgConflicts(Base): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base
|
||||
from .Cmd import Parent
|
||||
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base, Parent
|
||||
|
||||
class CmdPkgProvides(Base): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,5 +1,4 @@
|
|||
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base
|
||||
from .Cmd import Parent
|
||||
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base, Parent
|
||||
|
||||
class CmdPkgRequires(Base): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ...lib.log import WARNING, log
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdProjDir(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ...App import Scope
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdPythonpath(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,9 +1,12 @@
|
|||
from __future__ import annotations
|
||||
import os
|
||||
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
from ...App import Scope
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdPythonpathOrig(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,8 +1,12 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ...App import Scope
|
||||
from ...lib.log import DEBUG, log
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
# TODO: seems at least partly redundant to CmdPkgRequires / print_pkg_relations
|
||||
class CmdRequiredOsPkg(Cmd): # export
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdSummary(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdTest(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdTmplDir(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,14 +1,19 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ....CmdBase import CmdBase
|
||||
from ....CmdBase import CmdBase as Base
|
||||
from ..CmdCheck import CmdCheck as Parent
|
||||
|
||||
class Cmd(CmdBase): # export
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser
|
||||
|
||||
class Cmd(Base): # export
|
||||
|
||||
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||
super().__init__(parent, name, help)
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
super().add_arguments(parser)
|
||||
|
||||
__all__ = ['Parent', 'Cmd']
|
||||
|
|
|
|||
|
|
@ -1,7 +1,11 @@
|
|||
from argparse import ArgumentParser, Namespace
|
||||
from __future__ import annotations
|
||||
|
||||
from ....lib.log import NOTICE, log
|
||||
from .Cmd import Cmd, Parent
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
class CmdDep(Cmd): # export
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,19 @@
|
|||
from __future__ import annotations
|
||||
|
||||
from argparse import ArgumentParser
|
||||
from functools import cached_property
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from ...CmdBase import CmdBase
|
||||
from ...CmdBase import CmdBase as Base
|
||||
from ..CmdSecrets import CmdSecrets as Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Iterable
|
||||
from .lib.base import Attrs
|
||||
|
||||
from .lib.DistroContext import DistroContext
|
||||
|
||||
class Cmd(CmdBase): # export
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser
|
||||
from typing import Iterable
|
||||
|
||||
from .lib.base import Attrs
|
||||
|
||||
class Cmd(Base): # export
|
||||
|
||||
@cached_property
|
||||
def ctx(self) -> DistroContext:
|
||||
|
|
@ -49,3 +49,5 @@ class Cmd(CmdBase): # export
|
|||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
super().add_arguments(parser)
|
||||
parser.add_argument('packages', nargs = '*', help = 'Package names')
|
||||
|
||||
__all__ = ['Parent', 'Cmd']
|
||||
|
|
|
|||
|
|
@ -2,17 +2,15 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .Cmd import Cmd
|
||||
from .Cmd import Cmd, Parent
|
||||
from .lib.base import Attrs
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
from ..CmdSecrets import CmdSecrets
|
||||
|
||||
class CmdCompileTemplates(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdSecrets) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(
|
||||
parent, 'compile-templates', help = 'Compile package template files'
|
||||
)
|
||||
|
|
|
|||
|
|
@ -2,16 +2,14 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .Cmd import Cmd
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
from ..CmdSecrets import CmdSecrets
|
||||
|
||||
class CmdInstall(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdSecrets) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(
|
||||
parent,
|
||||
'install',
|
||||
|
|
|
|||
|
|
@ -2,16 +2,14 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .Cmd import Cmd
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
from ..CmdSecrets import CmdSecrets
|
||||
|
||||
class CmdListCompilationOutput(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdSecrets) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(
|
||||
parent,
|
||||
'list-compilation-output',
|
||||
|
|
|
|||
|
|
@ -2,16 +2,14 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .Cmd import Cmd
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import ArgumentParser, Namespace
|
||||
|
||||
from ..CmdSecrets import CmdSecrets
|
||||
|
||||
class CmdListSecrets(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdSecrets) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(parent, 'list-secrets', help = 'List package secret files')
|
||||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
|
|
|
|||
|
|
@ -2,16 +2,14 @@ from __future__ import annotations
|
|||
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from .Cmd import Cmd
|
||||
from .Cmd import Cmd, Parent
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from argparse import Namespace
|
||||
|
||||
from ..CmdSecrets import CmdSecrets
|
||||
|
||||
class CmdListTemplates(Cmd): # export
|
||||
|
||||
def __init__(self, parent: CmdSecrets) -> None:
|
||||
def __init__(self, parent: Parent) -> None:
|
||||
super().__init__(parent, 'list-templates', help = 'List package template files')
|
||||
|
||||
async def _run(self, args: Namespace) -> None:
|
||||
|
|
|
|||
|
|
@ -8,10 +8,10 @@ from typing import TYPE_CHECKING
|
|||
|
||||
from ....lib.log import DEBUG, NOTICE, WARNING, log
|
||||
from ....lib.ProcFilterGpg import ProcFilterGpg
|
||||
from .base import Attrs
|
||||
from .FilesContext import FilesContext
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .base import Attrs
|
||||
from typing import Iterable
|
||||
|
||||
from ....lib.Distro import Distro
|
||||
|
|
|
|||
|
|
@ -7,11 +7,11 @@ from tarfile import TarFile
|
|||
from typing import TYPE_CHECKING, Callable
|
||||
|
||||
from ....lib.log import DEBUG, log
|
||||
from ....lib.ExecContext import ExecContext
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from typing import Iterable
|
||||
|
||||
from ....lib.ExecContext import ExecContext
|
||||
from ....lib.FileContext import FileContext
|
||||
|
||||
def filter(
|
||||
|
|
|
|||
|
|
@ -3,10 +3,10 @@ from __future__ import annotations
|
|||
from typing import TYPE_CHECKING
|
||||
|
||||
from ....lib.ec.Local import Local
|
||||
from ....lib.FileContext import FileContext
|
||||
from .FilesContext import FilesContext
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from ....lib.FileContext import FileContext
|
||||
from .base import Attrs
|
||||
|
||||
async def compile_template_file(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue