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
|
|
@ -38,10 +38,14 @@
|
||||||
|
|
||||||
[tool.ruff.lint]
|
[tool.ruff.lint]
|
||||||
|
|
||||||
|
future-annotations = true
|
||||||
|
|
||||||
select = [
|
select = [
|
||||||
"F", # Pyflakes, includes F401
|
"F", # Pyflakes, includes F401
|
||||||
"E", # pycodestyle errors
|
"E", # pycodestyle errors
|
||||||
"W", # pycodestyle warnings
|
"W", # pycodestyle warnings
|
||||||
|
"TC", # type-checking import placement rules
|
||||||
|
"FA", # future annotations rules
|
||||||
]
|
]
|
||||||
|
|
||||||
ignore = [
|
ignore = [
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@
|
||||||
|
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import argparse
|
|
||||||
import os
|
import os
|
||||||
import pwd
|
import pwd
|
||||||
import re
|
import re
|
||||||
|
|
@ -19,10 +18,7 @@ from .lib.Distro import Distro
|
||||||
from .lib.log import DEBUG, ERR, log
|
from .lib.log import DEBUG, ERR, log
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
import os
|
import argparse
|
||||||
import pwd
|
|
||||||
import re
|
|
||||||
import sys
|
|
||||||
|
|
||||||
from typing import TypeAlias
|
from typing import TypeAlias
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,15 +2,15 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ..CmdBase import CmdBase
|
from ..App import App as Parent
|
||||||
|
from ..CmdBase import CmdBase as Base
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from ..App import App
|
|
||||||
from ..lib.Distro import Distro
|
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)
|
super().__init__(parent, name, help)
|
||||||
|
|
||||||
async def _run(self, args):
|
async def _run(self, args):
|
||||||
|
|
@ -20,3 +20,5 @@ class Cmd(CmdBase): # export
|
||||||
@property
|
@property
|
||||||
def distro(self) -> Distro:
|
def distro(self) -> Distro:
|
||||||
return self.app.distro
|
return self.app.distro
|
||||||
|
|
||||||
|
__all__ = ['Parent', 'Cmd']
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
from ..App import App
|
class CmdPkg(Cmd): # export
|
||||||
from .Cmd import Cmd as CmdBase
|
|
||||||
|
|
||||||
class CmdPkg(CmdBase): # export
|
def __init__(self, parent: Parent) -> None:
|
||||||
|
|
||||||
def __init__(self, parent: App) -> None:
|
|
||||||
super().__init__(parent, 'pkg', help = 'System package manager wrapper')
|
super().__init__(parent, 'pkg', help = 'System package manager wrapper')
|
||||||
self.load_subcommands()
|
self.load_subcommands()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
from ..App import App
|
class CmdPlatform(Cmd): # export
|
||||||
from .Cmd import Cmd as CmdBase
|
|
||||||
|
|
||||||
class CmdPlatform(CmdBase): # export
|
def __init__(self, parent: Parent) -> None:
|
||||||
|
|
||||||
def __init__(self, parent: App) -> None:
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
parent, 'platform', help = 'Miscellaneous platform-related comamnds'
|
parent, 'platform', help = 'Miscellaneous platform-related comamnds'
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
from ..App import App
|
class CmdPosix(Cmd): # export
|
||||||
from .Cmd import Cmd as CmdBase
|
|
||||||
|
|
||||||
class CmdPosix(CmdBase): # export
|
def __init__(self, parent: Parent) -> None:
|
||||||
|
|
||||||
def __init__(self, parent: App) -> None:
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
parent,
|
parent,
|
||||||
'posix',
|
'posix',
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,17 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
from ..App import App
|
class CmdProjects(Cmd): # export
|
||||||
from .Cmd import Cmd as CmdBase
|
|
||||||
|
|
||||||
class CmdProjects(CmdBase): # export
|
def __init__(self, parent: Parent) -> None:
|
||||||
|
|
||||||
def __init__(self, parent: App) -> None:
|
|
||||||
super().__init__(
|
super().__init__(
|
||||||
parent,
|
parent,
|
||||||
'projects',
|
'projects',
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
from ..App import App
|
class CmdSecrets(Cmd): # export
|
||||||
from .Cmd import Cmd as CmdBase
|
|
||||||
|
|
||||||
class CmdSecrets(CmdBase): # export
|
def __init__(self, parent: Parent) -> None:
|
||||||
|
|
||||||
def __init__(self, parent: App) -> None:
|
|
||||||
super().__init__(parent, 'secrets', help = 'Manage package secrets')
|
super().__init__(parent, 'secrets', help = 'Manage package secrets')
|
||||||
self.load_subcommands()
|
self.load_subcommands()
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,12 +2,19 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
from ...CmdBase import CmdBase as Base
|
||||||
from ..CmdPkg import CmdPkg
|
from ..CmdPkg import CmdPkg as Parent
|
||||||
|
|
||||||
from ..Cmd import Cmd as Base
|
if TYPE_CHECKING:
|
||||||
|
from ...lib.Distro import Distro
|
||||||
|
|
||||||
class Cmd(Base): # export
|
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)
|
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 typing import TYPE_CHECKING
|
||||||
from .Cmd import Cmd
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdDelete(Cmd): # export
|
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')
|
super().__init__(parent, 'delete', help = 'Delete packages by name')
|
||||||
|
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
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 typing import TYPE_CHECKING
|
||||||
from .Cmd import Cmd
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdDup(Cmd): # export
|
class CmdDup(Cmd): # export
|
||||||
|
|
||||||
def __init__(self, parent: CmdPkg) -> None:
|
def __init__(self, parent: Parent) -> None:
|
||||||
super().__init__(parent, 'dup', help = 'Upgrade distribution')
|
super().__init__(parent, 'dup', help = 'Upgrade distribution')
|
||||||
|
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
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 typing import TYPE_CHECKING
|
||||||
from .Cmd import Cmd
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdInstall(Cmd): # export
|
class CmdInstall(Cmd): # export
|
||||||
|
|
||||||
def __init__(self, parent: CmdPkg) -> None:
|
def __init__(self, parent: Parent) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
parent,
|
parent,
|
||||||
'install',
|
'install',
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
from ..CmdPkg import CmdPkg
|
class CmdLs(Cmd): # export
|
||||||
from .NamedPkgsCmd import NamedPkgsCmd as Base
|
|
||||||
|
|
||||||
class CmdLs(Base): # export
|
def __init__(self, parent: Parent) -> None:
|
||||||
|
|
||||||
def __init__(self, parent: CmdPkg) -> None:
|
|
||||||
super().__init__(parent, 'ls', help = 'List package contents')
|
super().__init__(parent, 'ls', help = 'List package contents')
|
||||||
|
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
from .NamedPkgsCmd import NamedPkgsCmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
from ..CmdPkg import CmdPkg
|
class CmdMeta(NamedPkgsCmd): # export
|
||||||
from .NamedPkgsCmd import NamedPkgsCmd as Base
|
|
||||||
|
|
||||||
class CmdMeta(Base): # export
|
def __init__(self, parent: Parent) -> None:
|
||||||
|
|
||||||
def __init__(self, parent: CmdPkg) -> None:
|
|
||||||
super().__init__(parent, 'meta', help = 'List package metadata')
|
super().__init__(parent, 'meta', help = 'List package metadata')
|
||||||
|
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
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 typing import TYPE_CHECKING
|
||||||
from .Cmd import Cmd
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdRebootRequired(Cmd): # export
|
class CmdRebootRequired(Cmd): # export
|
||||||
|
|
||||||
def __init__(self, parent: CmdPkg) -> None:
|
def __init__(self, parent: Parent) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
parent,
|
parent,
|
||||||
'reboot-required',
|
'reboot-required',
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,15 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from ..CmdPkg import CmdPkg
|
from typing import TYPE_CHECKING
|
||||||
from .Cmd import Cmd
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdRefresh(Cmd): # export
|
class CmdRefresh(Cmd): # export
|
||||||
|
|
||||||
def __init__(self, parent: CmdPkg) -> None:
|
def __init__(self, parent: Parent) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
parent,
|
parent,
|
||||||
'refresh',
|
'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 ...lib.PackageFilter import PackageFilterString
|
||||||
from ..CmdPkg import CmdPkg
|
from .Cmd import Cmd, Parent
|
||||||
from .Cmd import Cmd
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdSelect(Cmd): # export
|
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')
|
super().__init__(parent, 'select', help = 'Select packages by filter')
|
||||||
|
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
from ..CmdPkg import CmdPkg as Parent
|
class NamedPkgsCmd(Cmd): # export
|
||||||
from .Cmd import Cmd as Base
|
|
||||||
|
|
||||||
class NamedPkgsCmd(Base): # export
|
|
||||||
|
|
||||||
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||||
super().__init__(parent, name, help)
|
super().__init__(parent, name, help)
|
||||||
|
|
@ -11,3 +15,5 @@ class NamedPkgsCmd(Base): # export
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||||
super().add_arguments(parser)
|
super().add_arguments(parser)
|
||||||
parser.add_argument('names', nargs = '*', help = 'Package names')
|
parser.add_argument('names', nargs = '*', help = 'Package names')
|
||||||
|
|
||||||
|
__all__ = ['NamedPkgsCmd', 'Parent']
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,11 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from ...CmdBase import CmdBase as Base
|
||||||
|
from ..CmdPlatform import CmdPlatform as Parent
|
||||||
if TYPE_CHECKING:
|
|
||||||
from ..CmdPlatform import CmdPlatform
|
|
||||||
|
|
||||||
from ..Cmd import Cmd as Base
|
|
||||||
|
|
||||||
class Cmd(Base): # export
|
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)
|
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 ...lib.Distro import Distro
|
||||||
from ..Cmd import Cmd
|
from .Cmd import Cmd, Parent
|
||||||
from ..CmdPlatform import CmdPlatform
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdInfo(Cmd): # export
|
class CmdInfo(Cmd): # export
|
||||||
|
|
||||||
def __init__(self, parent: CmdPlatform) -> None:
|
def __init__(self, parent: Parent) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
parent, 'info', help = 'Retrieve information about target platform'
|
parent, 'info', help = 'Retrieve information about target platform'
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -1,17 +1,19 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...CmdBase import CmdBase
|
from ...CmdBase import CmdBase as Base
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from ..CmdPosix import CmdPosix as Parent
|
from ..CmdPosix import CmdPosix 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:
|
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||||
super().__init__(parent, name, help)
|
super().__init__(parent, name, help)
|
||||||
|
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||||
super().add_arguments(parser)
|
super().add_arguments(parser)
|
||||||
|
|
||||||
|
__all__ = ['Parent', 'Cmd']
|
||||||
|
|
|
||||||
|
|
@ -3,16 +3,14 @@ from __future__ import annotations
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...lib.util import copy
|
from ...lib.util import copy
|
||||||
from .Cmd import Cmd
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
from ..CmdPosix import CmdPosix
|
|
||||||
|
|
||||||
class CmdCopy(Cmd): # export
|
class CmdCopy(Cmd): # export
|
||||||
|
|
||||||
def __init__(self, parent: CmdPosix) -> None:
|
def __init__(self, parent: Parent) -> None:
|
||||||
super().__init__(parent, 'copy', help = 'Copy files')
|
super().__init__(parent, 'copy', help = 'Copy files')
|
||||||
|
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,13 @@
|
||||||
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
from ..CmdPosix import CmdPosix as Parent
|
class CmdTar(Cmd): # export
|
||||||
from .Cmd import Cmd as Base
|
|
||||||
|
|
||||||
class CmdTar(Base): # export
|
|
||||||
|
|
||||||
def __init__(self, parent: Parent) -> None:
|
def __init__(self, parent: Parent) -> None:
|
||||||
super().__init__(parent, 'tar', help = 'Handle tar archives')
|
super().__init__(parent, 'tar', help = 'Handle tar archives')
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,19 @@
|
||||||
from argparse import ArgumentParser
|
from __future__ import annotations
|
||||||
from collections.abc import AsyncIterator
|
|
||||||
from contextlib import asynccontextmanager
|
|
||||||
|
|
||||||
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.FileContext import FileContext
|
||||||
from ....lib.ProcFilterGpg import ProcFilterGpg
|
from ....lib.ProcFilterGpg import ProcFilterGpg
|
||||||
from ....lib.TarIo import TarIo
|
from ....lib.TarIo import TarIo
|
||||||
from ..CmdTar import CmdTar as Parent
|
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:
|
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||||
super().__init__(parent, name, help)
|
super().__init__(parent, name, help)
|
||||||
|
|
@ -27,3 +32,5 @@ class Cmd(CmdBase): # export
|
||||||
parser.add_argument(
|
parser.add_argument(
|
||||||
'-f', '--archive-path', required = True, help = 'Archive path'
|
'-f', '--archive-path', required = True, help = 'Archive path'
|
||||||
)
|
)
|
||||||
|
|
||||||
|
__all__ = ['Parent', 'Cmd']
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from argparse import ArgumentParser, Namespace
|
|
||||||
|
|
||||||
from ....lib.log import DEBUG, log
|
from ....lib.log import DEBUG, log
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdExtract(Cmd): # export
|
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 .Cmd import Cmd, Parent
|
||||||
from .lib.pkg_relations import VersionSyntax
|
from .lib.pkg_relations import VersionSyntax
|
||||||
from .lib.pkg_relations import pkg_relations as pkg_relations_list
|
from .lib.pkg_relations import pkg_relations as pkg_relations_list
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class BaseCmdPkgRelations(Cmd):
|
class BaseCmdPkgRelations(Cmd):
|
||||||
|
|
||||||
def pkg_relations(self, rel_type: str, args: Namespace) -> str:
|
def pkg_relations(self, rel_type: str, args: Namespace) -> str:
|
||||||
|
|
@ -130,3 +135,5 @@ class BaseCmdPkgRelations(Cmd):
|
||||||
|
|
||||||
async def _run(self, args: Namespace) -> None:
|
async def _run(self, args: Namespace) -> None:
|
||||||
return self.print_pkg_relations(self.relation, args)
|
return self.print_pkg_relations(self.relation, args)
|
||||||
|
|
||||||
|
__all__ = ['Parent', 'BaseCmdPkgRelations']
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,19 @@
|
||||||
from __future__ import annotations
|
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
|
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:
|
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||||
super().__init__(parent, name, help)
|
super().__init__(parent, name, help)
|
||||||
|
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||||
super().add_arguments(parser)
|
super().add_arguments(parser)
|
||||||
|
|
||||||
|
__all__ = ['Parent', 'Cmd']
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,18 @@
|
||||||
|
from __future__ import annotations
|
||||||
import datetime
|
import datetime
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from argparse import ArgumentParser, Namespace
|
|
||||||
from functools import lru_cache
|
from functools import lru_cache
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from ...lib.log import DEBUG, ERR, NOTICE, log
|
from ...lib.log import DEBUG, ERR, NOTICE, log
|
||||||
from ...lib.util import get_profile_env, pretty_cmd
|
from ...lib.util import get_profile_env, pretty_cmd
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdBuild(Cmd): # export
|
class CmdBuild(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,14 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from argparse import ArgumentParser, Namespace
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...lib.base import InputMode
|
from ...lib.base import InputMode
|
||||||
from ...lib.log import NOTICE, log
|
from ...lib.log import NOTICE, log
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from ...lib.base import Result
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from ...lib.base import Result
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdCanonicalizeRemotes(Cmd): # export
|
class CmdCanonicalizeRemotes(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdCflags(Cmd): # export
|
class CmdCflags(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,11 @@
|
||||||
|
from __future__ import annotations
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser
|
||||||
|
|
||||||
class CmdCheck(Cmd): # export
|
class CmdCheck(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdCommands(Cmd): # export
|
class CmdCommands(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
from .lib.templates import tmpl_render
|
from .lib.templates import tmpl_render
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdCreatePkgConfig(Cmd): # export
|
class CmdCreatePkgConfig(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdExepath(Cmd): # export
|
class CmdExepath(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,14 @@
|
||||||
|
from __future__ import annotations
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from argparse import ArgumentParser, Namespace
|
|
||||||
|
|
||||||
from ...lib.log import DEBUG, log
|
from ...lib.log import DEBUG, log
|
||||||
from ...lib.Uri import Uri
|
from ...lib.Uri import Uri
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdGetAuthInfo(Cmd): # export
|
class CmdGetAuthInfo(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdGetval(Cmd): # export
|
class CmdGetval(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdHtdocsDir(Cmd): # export
|
class CmdHtdocsDir(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdLdflags(Cmd): # export
|
class CmdLdflags(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdLdlibpath(Cmd): # export
|
class CmdLdlibpath(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdLibname(Cmd): # export
|
class CmdLibname(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,15 @@
|
||||||
|
from __future__ import annotations
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from argparse import ArgumentParser, Namespace
|
|
||||||
|
|
||||||
from ...lib.log import DEBUG, log
|
from ...lib.log import DEBUG, log
|
||||||
from ...lib.Uri import Uri
|
from ...lib.Uri import Uri
|
||||||
from ...lib.util import get_password, get_username, run_curl_into
|
from ...lib.util import get_password, get_username, run_curl_into
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdListRepos(Cmd): # export
|
class CmdListRepos(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
|
from __future__ import annotations
|
||||||
import re
|
import re
|
||||||
|
|
||||||
from argparse import ArgumentParser, Namespace
|
|
||||||
|
|
||||||
from ...lib.log import DEBUG, log
|
from ...lib.log import DEBUG, log
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdModules(Cmd): # export
|
class CmdModules(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdPath(Cmd): # export
|
class CmdPath(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base
|
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base, Parent
|
||||||
from .Cmd import Parent
|
|
||||||
|
|
||||||
class CmdPkgConflicts(Base): # export
|
class CmdPkgConflicts(Base): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base
|
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base, Parent
|
||||||
from .Cmd import Parent
|
|
||||||
|
|
||||||
class CmdPkgProvides(Base): # export
|
class CmdPkgProvides(Base): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,4 @@
|
||||||
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base
|
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base, Parent
|
||||||
from .Cmd import Parent
|
|
||||||
|
|
||||||
class CmdPkgRequires(Base): # export
|
class CmdPkgRequires(Base): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...lib.log import WARNING, log
|
from ...lib.log import WARNING, log
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdProjDir(Cmd): # export
|
class CmdProjDir(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,11 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdPythonpath(Cmd): # export
|
class CmdPythonpath(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,12 @@
|
||||||
|
from __future__ import annotations
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from argparse import ArgumentParser, Namespace
|
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdPythonpathOrig(Cmd): # export
|
class CmdPythonpathOrig(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,12 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from ...lib.log import DEBUG, log
|
from ...lib.log import DEBUG, log
|
||||||
from .Cmd import Cmd, Parent
|
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
|
# TODO: seems at least partly redundant to CmdPkgRequires / print_pkg_relations
|
||||||
class CmdRequiredOsPkg(Cmd): # export
|
class CmdRequiredOsPkg(Cmd): # export
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdSummary(Cmd): # export
|
class CmdSummary(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdTest(Cmd): # export
|
class CmdTest(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
from argparse import ArgumentParser, Namespace
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdTmplDir(Cmd): # export
|
class CmdTmplDir(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,19 @@
|
||||||
from __future__ import annotations
|
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
|
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:
|
def __init__(self, parent: Parent, name: str, help: str) -> None:
|
||||||
super().__init__(parent, name, help)
|
super().__init__(parent, name, help)
|
||||||
|
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||||
super().add_arguments(parser)
|
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 ....lib.log import NOTICE, log
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
class CmdDep(Cmd): # export
|
class CmdDep(Cmd): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,19 +1,19 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
|
||||||
from functools import cached_property
|
from functools import cached_property
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ...CmdBase import CmdBase
|
from ...CmdBase import CmdBase as Base
|
||||||
from ..CmdSecrets import CmdSecrets as Parent
|
from ..CmdSecrets import CmdSecrets as Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
|
||||||
from typing import Iterable
|
|
||||||
from .lib.base import Attrs
|
|
||||||
|
|
||||||
from .lib.DistroContext import DistroContext
|
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
|
@cached_property
|
||||||
def ctx(self) -> DistroContext:
|
def ctx(self) -> DistroContext:
|
||||||
|
|
@ -49,3 +49,5 @@ class Cmd(CmdBase): # export
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||||
super().add_arguments(parser)
|
super().add_arguments(parser)
|
||||||
parser.add_argument('packages', nargs = '*', help = 'Package names')
|
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 typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .Cmd import Cmd
|
from .Cmd import Cmd, Parent
|
||||||
from .lib.base import Attrs
|
from .lib.base import Attrs
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
from ..CmdSecrets import CmdSecrets
|
|
||||||
|
|
||||||
class CmdCompileTemplates(Cmd): # export
|
class CmdCompileTemplates(Cmd): # export
|
||||||
|
|
||||||
def __init__(self, parent: CmdSecrets) -> None:
|
def __init__(self, parent: Parent) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
parent, 'compile-templates', help = 'Compile package template files'
|
parent, 'compile-templates', help = 'Compile package template files'
|
||||||
)
|
)
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,14 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .Cmd import Cmd
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
from ..CmdSecrets import CmdSecrets
|
|
||||||
|
|
||||||
class CmdInstall(Cmd): # export
|
class CmdInstall(Cmd): # export
|
||||||
|
|
||||||
def __init__(self, parent: CmdSecrets) -> None:
|
def __init__(self, parent: Parent) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
parent,
|
parent,
|
||||||
'install',
|
'install',
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,14 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .Cmd import Cmd
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
from ..CmdSecrets import CmdSecrets
|
|
||||||
|
|
||||||
class CmdListCompilationOutput(Cmd): # export
|
class CmdListCompilationOutput(Cmd): # export
|
||||||
|
|
||||||
def __init__(self, parent: CmdSecrets) -> None:
|
def __init__(self, parent: Parent) -> None:
|
||||||
super().__init__(
|
super().__init__(
|
||||||
parent,
|
parent,
|
||||||
'list-compilation-output',
|
'list-compilation-output',
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,14 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .Cmd import Cmd
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
from ..CmdSecrets import CmdSecrets
|
|
||||||
|
|
||||||
class CmdListSecrets(Cmd): # export
|
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')
|
super().__init__(parent, 'list-secrets', help = 'List package secret files')
|
||||||
|
|
||||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||||
|
|
|
||||||
|
|
@ -2,16 +2,14 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .Cmd import Cmd
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import Namespace
|
from argparse import Namespace
|
||||||
|
|
||||||
from ..CmdSecrets import CmdSecrets
|
|
||||||
|
|
||||||
class CmdListTemplates(Cmd): # export
|
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')
|
super().__init__(parent, 'list-templates', help = 'List package template files')
|
||||||
|
|
||||||
async def _run(self, args: Namespace) -> None:
|
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.log import DEBUG, NOTICE, WARNING, log
|
||||||
from ....lib.ProcFilterGpg import ProcFilterGpg
|
from ....lib.ProcFilterGpg import ProcFilterGpg
|
||||||
from .base import Attrs
|
|
||||||
from .FilesContext import FilesContext
|
from .FilesContext import FilesContext
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from .base import Attrs
|
||||||
from typing import Iterable
|
from typing import Iterable
|
||||||
|
|
||||||
from ....lib.Distro import Distro
|
from ....lib.Distro import Distro
|
||||||
|
|
|
||||||
|
|
@ -7,11 +7,11 @@ from tarfile import TarFile
|
||||||
from typing import TYPE_CHECKING, Callable
|
from typing import TYPE_CHECKING, Callable
|
||||||
|
|
||||||
from ....lib.log import DEBUG, log
|
from ....lib.log import DEBUG, log
|
||||||
|
from ....lib.ExecContext import ExecContext
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Iterable
|
from typing import Iterable
|
||||||
|
|
||||||
from ....lib.ExecContext import ExecContext
|
|
||||||
from ....lib.FileContext import FileContext
|
from ....lib.FileContext import FileContext
|
||||||
|
|
||||||
def filter(
|
def filter(
|
||||||
|
|
|
||||||
|
|
@ -3,10 +3,10 @@ from __future__ import annotations
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ....lib.ec.Local import Local
|
from ....lib.ec.Local import Local
|
||||||
from ....lib.FileContext import FileContext
|
|
||||||
from .FilesContext import FilesContext
|
from .FilesContext import FilesContext
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from ....lib.FileContext import FileContext
|
||||||
from .base import Attrs
|
from .base import Attrs
|
||||||
|
|
||||||
async def compile_template_file(
|
async def compile_template_file(
|
||||||
|
|
|
||||||
|
|
@ -4,8 +4,10 @@ import asyncio
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
import contextlib
|
import contextlib
|
||||||
|
|
||||||
|
from typing import TypeVar, TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from collections.abc import Awaitable, Generator
|
from collections.abc import Awaitable, Generator
|
||||||
from typing import TypeVar
|
|
||||||
|
|
||||||
T = TypeVar('T')
|
T = TypeVar('T')
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,13 +3,13 @@ from __future__ import annotations
|
||||||
import abc
|
import abc
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from argparse import ArgumentParser
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .log import ERR
|
from .log import ERR
|
||||||
from .Types import LoadTypes, Types
|
from .Types import LoadTypes, Types
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from argparse import ArgumentParser
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
from .App import App
|
from .App import App
|
||||||
|
|
|
||||||
|
|
@ -9,11 +9,12 @@ from functools import cached_property
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .log import ERR, INFO, WARNING, log
|
from .log import ERR, INFO, WARNING, log
|
||||||
|
from .base import InputMode
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Iterable
|
from typing import Iterable
|
||||||
|
|
||||||
from .base import InputMode, Result
|
from .base import Result
|
||||||
from .ExecContext import ExecContext
|
from .ExecContext import ExecContext
|
||||||
from .Package import Package
|
from .Package import Package
|
||||||
from .PackageFilter import PackageFilter
|
from .PackageFilter import PackageFilter
|
||||||
|
|
|
||||||
|
|
@ -8,10 +8,11 @@ from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .log import DEBUG, ERR, log
|
from .log import DEBUG, ERR, log
|
||||||
from .Uri import Uri
|
from .Uri import Uri
|
||||||
|
from .ProcFilter import ProcPipeline
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .base import Result, StatResult
|
from .base import Result, StatResult
|
||||||
from .ProcFilter import ProcFilter, ProcPipeline
|
from .ProcFilter import ProcFilter
|
||||||
|
|
||||||
class FileContext(abc.ABC):
|
class FileContext(abc.ABC):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,10 @@
|
||||||
|
from __future__ import annotations
|
||||||
import abc
|
import abc
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
from .Package import Package
|
from .Package import Package
|
||||||
|
|
||||||
class PackageFilter(abc.ABC):
|
class PackageFilter(abc.ABC):
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from .base import Result
|
|
||||||
from .ProcFilter import ProcFilter
|
from .ProcFilter import ProcFilter
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from .base import Result
|
||||||
from .ExecContext import ExecContext
|
from .ExecContext import ExecContext
|
||||||
|
|
||||||
class ProcFilterGpg(ProcFilter):
|
class ProcFilterGpg(ProcFilter):
|
||||||
|
|
|
||||||
|
|
@ -6,10 +6,13 @@ import tarfile
|
||||||
|
|
||||||
from tarfile import TarFile, TarInfo
|
from tarfile import TarFile, TarInfo
|
||||||
|
|
||||||
from .base import StatResult
|
|
||||||
from .CopyContext import CopyContext
|
from .CopyContext import CopyContext
|
||||||
from .ExecContext import ExecContext
|
from .ExecContext import ExecContext
|
||||||
from .log import DEBUG, ERR, log
|
from .log import DEBUG, ERR, log
|
||||||
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
from .base import StatResult
|
||||||
|
|
||||||
class TarIo(CopyContext):
|
class TarIo(CopyContext):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,15 @@
|
||||||
|
from __future__ import annotations
|
||||||
import abc
|
import abc
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from collections.abc import Iterator
|
|
||||||
from typing import TYPE_CHECKING, Generic, Iterable, TypeVar
|
from typing import TYPE_CHECKING, Generic, Iterable, TypeVar
|
||||||
|
|
||||||
from .log import OFF, log, parse_log_level
|
from .log import OFF, log, parse_log_level
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from collections.abc import Iterator
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
T = TypeVar('T')
|
T = TypeVar('T')
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
|
||||||
|
|
||||||
from enum import Enum, auto
|
from enum import Enum, auto
|
||||||
from typing import NamedTuple, TypeAlias
|
from typing import NamedTuple, TypeAlias, TYPE_CHECKING
|
||||||
|
|
||||||
|
if TYPE_CHECKING:
|
||||||
|
import os
|
||||||
|
|
||||||
class InputMode(Enum):
|
class InputMode(Enum):
|
||||||
Interactive = auto()
|
Interactive = auto()
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,10 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ..base import Result
|
|
||||||
from ..FileContext import FileContext as Base
|
from ..FileContext import FileContext as Base
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from ..base import Result
|
||||||
from ..ExecContext import ExecContext
|
from ..ExecContext import ExecContext
|
||||||
from ..Uri import Uri
|
from ..Uri import Uri
|
||||||
from .Local import Local
|
from .Local import Local
|
||||||
|
|
|
||||||
|
|
@ -8,13 +8,12 @@ import sys
|
||||||
from enum import Flag, auto
|
from enum import Flag, auto
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
from ..base import Result
|
|
||||||
from ..ExecContext import ExecContext
|
from ..ExecContext import ExecContext
|
||||||
from ..log import DEBUG, ERR, INFO, NOTICE, WARNING, log
|
from ..log import DEBUG, ERR, INFO, NOTICE, WARNING, log
|
||||||
from ..Uri import Uri
|
from ..Uri import Uri
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from ..Uri import Uri
|
from ..base import Result
|
||||||
|
|
||||||
class SSHClient(ExecContext):
|
class SSHClient(ExecContext):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,8 @@ from __future__ import annotations
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
import paramiko # type: ignore[import-untyped] # error: Library stubs not installed for "paramiko"
|
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 ...base import Result
|
||||||
from ...log import ERR, log
|
from ...log import ERR, log
|
||||||
|
|
@ -12,9 +14,6 @@ from .util import join_cmd
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Any
|
from typing import Any
|
||||||
|
|
||||||
import paramiko.agent # type: ignore[import-untyped]
|
|
||||||
import paramiko.SCPClient # type: ignore[import-untyped]
|
|
||||||
|
|
||||||
class Paramiko(Base):
|
class Paramiko(Base):
|
||||||
|
|
||||||
def __init__(self, uri, *args, **kwargs) -> None:
|
def __init__(self, uri, *args, **kwargs) -> None:
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,6 @@ import json
|
||||||
import os
|
import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from argparse import Namespace
|
|
||||||
from enum import Enum, auto
|
from enum import Enum, auto
|
||||||
from typing import TYPE_CHECKING, Iterable, TypeVar, cast
|
from typing import TYPE_CHECKING, Iterable, TypeVar, cast
|
||||||
|
|
||||||
|
|
@ -13,6 +12,7 @@ from .log import DEBUG, ERR, log
|
||||||
from .Uri import Uri
|
from .Uri import Uri
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
from argparse import Namespace
|
||||||
from .ExecContext import ExecContext
|
from .ExecContext import ExecContext
|
||||||
from .FileContext import FileContext
|
from .FileContext import FileContext
|
||||||
from .ProcFilter import ProcFilter, ProcPipeline
|
from .ProcFilter import ProcFilter, ProcPipeline
|
||||||
|
|
@ -93,7 +93,7 @@ async def run_curl_into(
|
||||||
raise TypeError(
|
raise TypeError(
|
||||||
f'Expected {expected_type.__name__}, got {type(ret).__name__} from Curl'
|
f'Expected {expected_type.__name__}, got {type(ret).__name__} from Curl'
|
||||||
)
|
)
|
||||||
return cast(T, ret)
|
return cast('T', ret)
|
||||||
|
|
||||||
async def run_askpass(
|
async def run_askpass(
|
||||||
askpass_env: list[str],
|
askpass_env: list[str],
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue