make: Miscellaneous minor fixes and improvements #58
60 changed files with 115 additions and 70 deletions
|
|
@ -17,6 +17,9 @@
|
||||||
|
|
||||||
[tool.isort]
|
[tool.isort]
|
||||||
|
|
||||||
|
multi_line_output = 3
|
||||||
|
line_length = 88
|
||||||
|
lines_after_imports = 1
|
||||||
lines_between_sections = 1
|
lines_between_sections = 1
|
||||||
lines_between_types = 1
|
lines_between_types = 1
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -505,7 +505,8 @@ ifeq ($(CREATE_PKG_CONFIG),true)
|
||||||
BUILD_PKG_CONFIGDIR = $(TOPDIR)/make
|
BUILD_PKG_CONFIGDIR = $(TOPDIR)/make
|
||||||
endif
|
endif
|
||||||
LOCAL_PKG_CONFIG = $(PROJECT).pc
|
LOCAL_PKG_CONFIG = $(PROJECT).pc
|
||||||
BUILD_PKG_CONFIG = $(BUILD_PKG_CONFIGDIR)/$(LOCAL_PKG_CONFIG)
|
# As of now, this is not used by any downstream project, so disable it to reduce complexity.
|
||||||
|
#BUILD_PKG_CONFIG = $(BUILD_PKG_CONFIGDIR)/$(LOCAL_PKG_CONFIG)
|
||||||
INSTALLED_PKG_CONFIG = $(addprefix $(INSTALL_PKG_CONFIGDIR)/,$(PKG_CONFIG))
|
INSTALLED_PKG_CONFIG = $(addprefix $(INSTALL_PKG_CONFIGDIR)/,$(PKG_CONFIG))
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -67,7 +67,7 @@ JWB_SCRIPT_DIR := $(firstword $(wildcard $(JWBDIR)/scripts $(JWBDIR
|
||||||
|
|
||||||
include $(JWBDIR)/make/py-version.mk
|
include $(JWBDIR)/make/py-version.mk
|
||||||
|
|
||||||
JW_PKG_PY = $(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) --topdir-format absolute $(JW_PKG_PY_EXTRA_OPTS)
|
JW_PKG_PY = $(PYTHON) $(JWB_SCRIPT_DIR)/jw-pkg.py -p $(PROJECTS_DIR) -t $(TOPDIR) $(JW_PKG_PY_EXTRA_OPTS)
|
||||||
|
|
||||||
# -- product
|
# -- product
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -309,6 +309,8 @@ pull-all: purge git-get git-pull-all
|
||||||
|
|
||||||
diff-all diff: $(SSH_WRAPPER_SH)
|
diff-all diff: $(SSH_WRAPPER_SH)
|
||||||
$(PGIT_SH) --porcelain diff
|
$(PGIT_SH) --porcelain diff
|
||||||
|
diff-projects:
|
||||||
|
PGIT_SH_PROJECTS="$(patsubst %/.git,%,$(wildcard $(addsuffix /.git,$(shell make -s build-order))))" $(PGIT_SH) --porcelain diff
|
||||||
|
|
||||||
get-official: git-get-official
|
get-official: git-get-official
|
||||||
get-maintainer: git-get-maintainer
|
get-maintainer: git-get-maintainer
|
||||||
|
|
|
||||||
|
|
@ -29,6 +29,10 @@ ifndef PY_CHECK_RUFF
|
||||||
endif
|
endif
|
||||||
endif
|
endif
|
||||||
|
|
||||||
|
ifndef PY_CHECK_ISORT
|
||||||
|
PY_CHECK_ISORT := $(firstword $(wildcard /usr/bin/isort))
|
||||||
|
endif
|
||||||
|
|
||||||
ifndef PY_CHECK_YAPF
|
ifndef PY_CHECK_YAPF
|
||||||
PY_CHECK_YAPF := $(firstword $(wildcard /usr/bin/yapf /usr/bin/yapf3))
|
PY_CHECK_YAPF := $(firstword $(wildcard /usr/bin/yapf /usr/bin/yapf3))
|
||||||
endif
|
endif
|
||||||
|
|
@ -67,6 +71,9 @@ endif
|
||||||
py-format:
|
py-format:
|
||||||
find . -type f -name '*.py' -print0 | \
|
find . -type f -name '*.py' -print0 | \
|
||||||
xargs -0 sed -i -E '1{/^# -\*- coding: utf-8 -\*-$$/{:a;N;/\n[[:space:]]*$$/ba;s/^# -\*- coding: utf-8 -\*-\n([[:space:]]*\n)*/ /;s/^ //}}'
|
xargs -0 sed -i -E '1{/^# -\*- coding: utf-8 -\*-$$/{:a;N;/\n[[:space:]]*$$/ba;s/^# -\*- coding: utf-8 -\*-\n([[:space:]]*\n)*/ /;s/^ //}}'
|
||||||
|
ifneq ($(PY_CHECK_ISORT),)
|
||||||
|
$(PY_CHECK_ISORT) $(PY_CHECK_ROOTS)
|
||||||
|
endif
|
||||||
ifneq ($(PY_CHECK_YAPF),)
|
ifneq ($(PY_CHECK_YAPF),)
|
||||||
$(PY_CHECK_YAPF) --in-place --recursive $(PY_CHECK_ROOTS)
|
$(PY_CHECK_YAPF) --in-place --recursive $(PY_CHECK_ROOTS)
|
||||||
endif
|
endif
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@ import sys
|
||||||
|
|
||||||
from enum import Enum, auto
|
from enum import Enum, auto
|
||||||
from functools import cache
|
from functools import cache
|
||||||
from typing import Any, cast, override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, Any, cast, override
|
||||||
|
|
||||||
from .lib.App import App as Base
|
from .lib.App import App as Base
|
||||||
from .lib.Distro import Distro
|
from .lib.Distro import Distro
|
||||||
|
|
@ -19,8 +19,8 @@ from .lib.ProjectConf import ProjectConf
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
import argparse
|
import argparse
|
||||||
from argparse import ArgumentParser
|
|
||||||
|
|
||||||
|
from argparse import ArgumentParser
|
||||||
from typing import TypeAlias
|
from typing import TypeAlias
|
||||||
|
|
||||||
from .lib.ExecContext import ExecContext
|
from .lib.ExecContext import ExecContext
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
from typing import override
|
from typing import override
|
||||||
|
|
||||||
from .App import App
|
from .App import App
|
||||||
from .lib.Cmd import Cmd as Base
|
from .lib.Cmd import Cmd as Base
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from ..App import App as Parent
|
from ..App import App as Parent
|
||||||
from ..CmdBase import CmdBase as Base
|
from ..CmdBase import CmdBase as Base
|
||||||
|
|
@ -8,6 +8,7 @@ from ..CmdBase import CmdBase as Base
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import Namespace
|
from argparse import Namespace
|
||||||
from typing import Iterable
|
from typing import Iterable
|
||||||
|
|
||||||
from ..lib.Distro import Distro
|
from ..lib.Distro import Distro
|
||||||
|
|
||||||
class Cmd(Base): # export
|
class Cmd(Base): # export
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from ...CmdBase import CmdBase as Base
|
from ...CmdBase import CmdBase as Base
|
||||||
from ..CmdPosix import CmdPosix as Parent
|
from ..CmdPosix import CmdPosix as Parent
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from contextlib import asynccontextmanager
|
from contextlib import asynccontextmanager
|
||||||
from typing import Any, override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, Any, override
|
||||||
|
|
||||||
from ....CmdBase import CmdBase as Base
|
from ....CmdBase import CmdBase as Base
|
||||||
from ....lib.FileContext import FileContext
|
from ....lib.FileContext import FileContext
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
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, override
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from ...CmdBase import CmdBase as Base
|
from ...CmdBase import CmdBase as Base
|
||||||
from ..CmdProjects import CmdProjects as Parent
|
from ..CmdProjects import CmdProjects as Parent
|
||||||
|
|
|
||||||
|
|
@ -2,10 +2,9 @@ from __future__ import annotations
|
||||||
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from ...lib.base import InputMode
|
from ...lib.base import InputMode, Result
|
||||||
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 argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
from typing import TYPE_CHECKING, override
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
from typing import TYPE_CHECKING, override
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
|
||||||
|
|
@ -1,11 +1,13 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
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, override
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
from typing import TYPE_CHECKING, override
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
from typing import TYPE_CHECKING, override
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,12 +1,14 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
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, override
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,11 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
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, override
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from ...App import Scope
|
from ...App import Scope
|
||||||
from .Cmd import Cmd, Parent
|
from .Cmd import Cmd, Parent
|
||||||
from typing import TYPE_CHECKING, override
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base, Parent
|
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base
|
||||||
|
from .BaseCmdPkgRelations import Parent
|
||||||
|
|
||||||
class CmdPkgConflicts(Base): # export
|
class CmdPkgConflicts(Base): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base, Parent
|
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base
|
||||||
|
from .BaseCmdPkgRelations import Parent
|
||||||
|
|
||||||
class CmdPkgProvides(Base): # export
|
class CmdPkgProvides(Base): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base, Parent
|
from .BaseCmdPkgRelations import BaseCmdPkgRelations as Base
|
||||||
|
from .BaseCmdPkgRelations import Parent
|
||||||
|
|
||||||
class CmdPkgRequires(Base): # export
|
class CmdPkgRequires(Base): # export
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
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, override
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,10 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
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, override
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from .Cmd import Cmd, Parent
|
|
||||||
from typing import TYPE_CHECKING, override
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
|
from .Cmd import Cmd, Parent
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import ArgumentParser, Namespace
|
from argparse import ArgumentParser, Namespace
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from ....CmdBase import CmdBase as Base
|
from ....CmdBase import CmdBase as Base
|
||||||
from ..CmdCheck import CmdCheck as Parent
|
from ..CmdCheck import CmdCheck as Parent
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
import textwrap
|
import textwrap
|
||||||
|
|
||||||
from typing import Any, Iterable, TypeAlias, TypeGuard
|
from typing import Any, Iterable, TypeAlias, TypeGuard
|
||||||
|
|
||||||
TupleList: TypeAlias = Iterable[tuple[str, str]]
|
TupleList: TypeAlias = Iterable[tuple[str, str]]
|
||||||
|
|
|
||||||
|
|
@ -1,15 +1,15 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from functools import cached_property
|
from functools import cached_property
|
||||||
from typing import override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
from ...CmdBase import CmdBase as Base
|
from ...CmdBase import CmdBase as Base
|
||||||
from ..CmdSecrets import CmdSecrets as Parent
|
from ..CmdSecrets import CmdSecrets as Parent
|
||||||
from .lib.DistroContext import DistroContext
|
from .lib.DistroContext import DistroContext
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from collections.abc import Collection
|
|
||||||
from argparse import ArgumentParser
|
from argparse import ArgumentParser
|
||||||
|
from collections.abc import Collection
|
||||||
|
|
||||||
from .lib.base import Attrs
|
from .lib.base import Attrs
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,9 @@ from .FilesContext import FilesContext
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from collections.abc import Collection
|
from collections.abc import Collection
|
||||||
from .base import Attrs
|
|
||||||
|
|
||||||
from ....lib.Distro import Distro
|
from ....lib.Distro import Distro
|
||||||
|
from .base import Attrs
|
||||||
|
|
||||||
class DistroContext(FilesContext):
|
class DistroContext(FilesContext):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -6,8 +6,8 @@ import tarfile
|
||||||
from tarfile import TarFile
|
from tarfile import TarFile
|
||||||
from typing import TYPE_CHECKING, Callable
|
from typing import TYPE_CHECKING, Callable
|
||||||
|
|
||||||
from ....lib.log import DEBUG, log
|
|
||||||
from ....lib.ExecContext import ExecContext
|
from ....lib.ExecContext import ExecContext
|
||||||
|
from ....lib.log import DEBUG, log
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Iterable
|
from typing import Iterable
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ import os
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, Namespace
|
from argparse import ArgumentDefaultsHelpFormatter, ArgumentParser, Namespace
|
||||||
from typing import Any, cast, override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, Any, cast, override
|
||||||
|
|
||||||
from .AsyncRunner import AsyncRunner
|
from .AsyncRunner import AsyncRunner
|
||||||
from .log import (
|
from .log import (
|
||||||
|
|
@ -21,14 +21,14 @@ from .log import (
|
||||||
set_log_flags,
|
set_log_flags,
|
||||||
set_log_level
|
set_log_level
|
||||||
)
|
)
|
||||||
|
|
||||||
from .Types import LoadTypes
|
from .Types import LoadTypes
|
||||||
from .util import pretty_cmd
|
from .util import pretty_cmd
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
|
import types
|
||||||
|
|
||||||
from collections.abc import Awaitable, Collection
|
from collections.abc import Awaitable, Collection
|
||||||
from typing import TypeVar
|
from typing import TypeVar
|
||||||
|
|
||||||
T = TypeVar('T')
|
T = TypeVar('T')
|
||||||
|
|
||||||
class App: # export
|
class App: # export
|
||||||
|
|
@ -119,8 +119,8 @@ class App: # export
|
||||||
self.parser = parser
|
self.parser = parser
|
||||||
|
|
||||||
title = 'Available subcommands'
|
title = 'Available subcommands'
|
||||||
if hasattr(parent, 'name'):
|
if isinstance(parent, AbstractCmd):
|
||||||
title += ' of ' + getattr(parent, 'name')
|
title += ' of ' + parent.name
|
||||||
subparsers = parser.add_subparsers(
|
subparsers = parser.add_subparsers(
|
||||||
title = title, metavar = '', dest = 'command'
|
title = title, metavar = '', dest = 'command'
|
||||||
)
|
)
|
||||||
|
|
@ -139,7 +139,7 @@ class App: # export
|
||||||
sc.cmd, sc.parser, sc.cmd.children, all = all
|
sc.cmd, sc.parser, sc.cmd.children, all = all
|
||||||
)
|
)
|
||||||
return
|
return
|
||||||
args, unknown = self.__parser.parse_known_args()
|
args, _ = self.__parser.parse_known_args()
|
||||||
cmd_name = getattr(args, 'command', None)
|
cmd_name = getattr(args, 'command', None)
|
||||||
if cmd_name in scs:
|
if cmd_name in scs:
|
||||||
sc = scs[cmd_name]
|
sc = scs[cmd_name]
|
||||||
|
|
@ -185,7 +185,7 @@ class App: # export
|
||||||
)
|
)
|
||||||
self._add_arguments(self.__parser)
|
self._add_arguments(self.__parser)
|
||||||
|
|
||||||
args, unknown = self.__parser.parse_known_args()
|
args, _ = self.__parser.parse_known_args()
|
||||||
set_log_flags(args.log_flags)
|
set_log_flags(args.log_flags)
|
||||||
set_log_level(args.log_level)
|
set_log_level(args.log_level)
|
||||||
|
|
||||||
|
|
@ -222,7 +222,12 @@ class App: # export
|
||||||
async def __aenter__(self) -> None:
|
async def __aenter__(self) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def __aexit__(self, exc_type: Any, exc: Any, tb: Any) -> None:
|
async def __aexit__(
|
||||||
|
self,
|
||||||
|
exc_type: type[BaseException] | None,
|
||||||
|
exc: BaseException | None,
|
||||||
|
tb: types.TracebackType | None,
|
||||||
|
) -> None:
|
||||||
pass
|
pass
|
||||||
|
|
||||||
async def __run(self, argv: list[str] | None = None) -> None:
|
async def __run(self, argv: list[str] | None = None) -> None:
|
||||||
|
|
@ -230,16 +235,13 @@ class App: # export
|
||||||
try:
|
try:
|
||||||
# Import argcomplete only here to not require it to be compatible
|
# Import argcomplete only here to not require it to be compatible
|
||||||
# with minimal environments
|
# with minimal environments
|
||||||
from argcomplete.completers import ( # type: ignore[import-not-found, unused-ignore]
|
from argcomplete.completers import BaseCompleter # type: ignore[import-not-found, unused-ignore] # isort: skip
|
||||||
BaseCompleter
|
|
||||||
)
|
|
||||||
|
|
||||||
class NoopCompleter(BaseCompleter): # type: ignore[misc, unused-ignore]
|
class NoopCompleter(BaseCompleter): # type: ignore[misc, unused-ignore]
|
||||||
|
|
||||||
@override
|
@override
|
||||||
def __call__( # pyright: ignore[reportGeneralTypeIssues]
|
def __call__( # pyright: ignore[reportGeneralTypeIssues]
|
||||||
self, *args: Any, **kwargs: Any
|
self, *args: Any, **kwargs: Any) -> None:
|
||||||
) -> None:
|
|
||||||
return None
|
return None
|
||||||
|
|
||||||
import argcomplete # type: ignore[import-not-found, unused-ignore]
|
import argcomplete # type: ignore[import-not-found, unused-ignore]
|
||||||
|
|
@ -266,7 +268,7 @@ class App: # export
|
||||||
if isinstance(ret, int) and ret >= 0 and ret <= 0xFF:
|
if isinstance(ret, int) and ret >= 0 and ret <= 0xFF:
|
||||||
exit_status = ret
|
exit_status = ret
|
||||||
except Exception as e:
|
except Exception as e:
|
||||||
log_m(ERR, 'Failed: {}'.format(repr(e) if self.__back_trace else str(e)))
|
log_m(ERR, f'Failed: {repr(e) if self.__back_trace else str(e)}')
|
||||||
exit_status = 1
|
exit_status = 1
|
||||||
# AssertionErrors are programming errors, hence a programmer should
|
# AssertionErrors are programming errors, hence a programmer should
|
||||||
# get a chance to figure it out
|
# get a chance to figure it out
|
||||||
|
|
@ -339,6 +341,7 @@ class App: # export
|
||||||
self.__async_runner = None
|
self.__async_runner = None
|
||||||
return ret
|
return ret
|
||||||
|
|
||||||
|
|
||||||
def run_sub_commands( # export
|
def run_sub_commands( # export
|
||||||
description: str = '',
|
description: str = '',
|
||||||
name_filter: str = '^Cmd.*',
|
name_filter: str = '^Cmd.*',
|
||||||
|
|
|
||||||
|
|
@ -4,7 +4,7 @@ import asyncio
|
||||||
import concurrent.futures
|
import concurrent.futures
|
||||||
import contextlib
|
import contextlib
|
||||||
|
|
||||||
from typing import Any, TypeVar, TYPE_CHECKING, cast
|
from typing import TYPE_CHECKING, Any, TypeVar, cast
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from collections.abc import Awaitable, Generator
|
from collections.abc import Awaitable, Generator
|
||||||
|
|
|
||||||
|
|
@ -8,8 +8,8 @@ import sys
|
||||||
from functools import cached_property
|
from functools import cached_property
|
||||||
from typing import TYPE_CHECKING, Any
|
from typing import TYPE_CHECKING, Any
|
||||||
|
|
||||||
from .log import ERR, INFO, WARNING, log
|
|
||||||
from .base import InputMode
|
from .base import InputMode
|
||||||
|
from .log import ERR, INFO, WARNING, log
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from collections.abc import Collection
|
from collections.abc import Collection
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import errno
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from decimal import ROUND_FLOOR, Decimal
|
from decimal import ROUND_FLOOR, Decimal
|
||||||
from typing import Any, override, TYPE_CHECKING, NamedTuple
|
from typing import TYPE_CHECKING, Any, NamedTuple, override
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from typing import Type
|
from typing import Type
|
||||||
|
|
|
||||||
|
|
@ -4,11 +4,11 @@ import abc
|
||||||
|
|
||||||
from enum import Enum, auto
|
from enum import Enum, auto
|
||||||
from functools import cached_property
|
from functools import cached_property
|
||||||
from typing import Any, override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, Any, override
|
||||||
|
|
||||||
from .log import DEBUG, ERR, log
|
from .log import DEBUG, ERR, log
|
||||||
from .Uri import Uri
|
|
||||||
from .ProcFilter import ProcPipeline
|
from .ProcFilter import ProcPipeline
|
||||||
|
from .Uri import Uri
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .base import Result, StatResult
|
from .base import Result, StatResult
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import override, Any
|
from typing import Any, override
|
||||||
|
|
||||||
meta_tags = [
|
meta_tags = [
|
||||||
'name',
|
'name',
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,5 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import abc
|
import abc
|
||||||
import re
|
import re
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,11 +5,11 @@ import io
|
||||||
import tarfile
|
import tarfile
|
||||||
|
|
||||||
from tarfile import TarFile, TarInfo
|
from tarfile import TarFile, TarInfo
|
||||||
|
from typing import TYPE_CHECKING, Any, override
|
||||||
|
|
||||||
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, Any, override
|
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from .base import StatResult
|
from .base import StatResult
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,7 @@ import os
|
||||||
import re
|
import re
|
||||||
import sys
|
import sys
|
||||||
|
|
||||||
from typing import Any, override, TYPE_CHECKING, Generic, Iterable, TypeVar
|
from typing import TYPE_CHECKING, Any, Generic, Iterable, TypeVar, override
|
||||||
|
|
||||||
from .log import ERR, OFF, log, parse_log_level
|
from .log import ERR, OFF, log, parse_log_level
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,7 +3,7 @@ from __future__ import annotations
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
from functools import cached_property
|
from functools import cached_property
|
||||||
from typing import override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, override
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
import urllib.parse
|
import urllib.parse
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, Any, override
|
||||||
|
|
||||||
from ...Distro import Distro as Base
|
from ...Distro import Distro as Base
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from typing import Any, override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, Any, override
|
||||||
|
|
||||||
from ...Distro import Distro as Base
|
from ...Distro import Distro as Base
|
||||||
from ...log import NOTICE, log
|
from ...log import NOTICE, log
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, Any, override
|
||||||
|
|
||||||
from ..FileContext import FileContext as Base
|
from ..FileContext import FileContext as Base
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -2,7 +2,7 @@ from __future__ import annotations
|
||||||
|
|
||||||
import os
|
import os
|
||||||
|
|
||||||
from typing import Any, override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, Any, override
|
||||||
|
|
||||||
from ...base import InputMode
|
from ...base import InputMode
|
||||||
from ...util import run_cmd
|
from ...util import run_cmd
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, override, TYPE_CHECKING
|
from typing import TYPE_CHECKING, Any, override
|
||||||
|
|
||||||
# Tolerate missing paramiko imports. jw-pkg is designed to work with what it
|
# Tolerate missing paramiko imports. jw-pkg is designed to work with what it
|
||||||
# finds.
|
# finds.
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,7 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import pkgutil
|
import pkgutil
|
||||||
|
|
||||||
from importlib import import_module
|
from importlib import import_module
|
||||||
from typing import TYPE_CHECKING
|
from typing import TYPE_CHECKING
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -5,9 +5,8 @@ import re
|
||||||
import sys
|
import sys
|
||||||
import syslog
|
import syslog
|
||||||
|
|
||||||
from enum import Flag, auto
|
|
||||||
|
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
|
from enum import Flag, auto
|
||||||
from os.path import basename
|
from os.path import basename
|
||||||
from typing import TYPE_CHECKING, cast, override
|
from typing import TYPE_CHECKING, cast, override
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,6 @@
|
||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
from typing import Any, TYPE_CHECKING, Collection, Iterable, cast
|
from typing import TYPE_CHECKING, Any, Collection, Iterable, cast
|
||||||
|
|
||||||
from ..base import InputMode
|
from ..base import InputMode
|
||||||
from ..Package import Package
|
from ..Package import Package
|
||||||
|
|
|
||||||
|
|
@ -13,6 +13,7 @@ from .Uri import Uri
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from argparse import Namespace
|
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
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue