lib.ExecApp, ec.Local: Don't use keyword "local" as URI
Some checks failed
CI / Packaging - Kali Linux (pull_request) Failing after 5m6s
CI / Packaging - OpenSUSE Tumbleweed (pull_request) Failing after 4m44s
CI / Packaging test (pull_request) Failing after 0s

ExecApp's --target parameter and the ec.Local.__init__()'s uri argument carry
"local" as their default value which was meant as a keyword but doesn't pass
as an URI. Fix that.

Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.5.0
Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2026-11-09 19:38:36 +01:00
commit e558efb4cc
Signed by: Jan Lindemann
GPG key ID: 3750640C9E25DD61
4 changed files with 9 additions and 5 deletions

View file

@ -46,7 +46,7 @@ class ExecApp(Base): # export
help = "Be verbose on stderr about what's being done on the distro level",
)
parser.add_argument(
'--target', default = 'local', help = 'Run commands on this host'
'--target', default = 'local://', help = 'Run commands on this host'
)
parser.add_argument(
'--path-filter',

View file

@ -21,7 +21,7 @@ if TYPE_CHECKING:
class Local(Base):
def __init__(self, uri: str | Uri = 'local', *args: Any, **kwargs: Any) -> None:
def __init__(self, uri: str | Uri = 'local://', *args: Any, **kwargs: Any) -> None:
super().__init__(uri, *args, **kwargs)
@cache

View file

@ -9,10 +9,10 @@ import tempfile
from typing import TYPE_CHECKING, override
from jw.pkg.cmds.secrets.lib.FilesContext import FilesContext
from jw.pkg.cmds.secrets.lib.base import Attrs
from jw.pkg.lib.PathFilter import Verdict
from jw.pkg.cmds.secrets.lib.FilesContext import FilesContext
from jw.pkg.lib.ec.Local import Local
from jw.pkg.lib.PathFilter import Verdict
if TYPE_CHECKING:
import os

View file

@ -52,9 +52,13 @@ opts = [o for a in app.parser._actions for o in getattr(a, 'option_strings', ())
for opt in ('--interactive', '--verbose', '--target'):
assert opt in opts, f'{opt} must be registered by ExecApp'
# -- The default target is a conforming URI: a bare keyword would
# be parsed as a file path, and a downstream URI round-trip
# would misread it as a hostname
assert app.parser.get_default('target') == 'local://'
# -- Exiting the async context must close the app, through the
# App.__aexit__() that ExecApp.__aexit__() chains to.
async def exit_context() -> None:
async with app:
pass