lib.distros.Distro.install_*(): Add install_deps
The install methods of Distro inconsistently resolve dependencies or don't depending on the descendant's implementation. Pin that more unambigously by adding a new parameter install_deps, defaulting to True, to the following methods of lib.Distro: _install_local_files() _install_urls() _install_urls_and_names() install() The implementations in lib.distros.* make use of the new lib.pm.*.install_packages() method introduced by the previous commit. Add a unit test directory per Distro descendant. Assisted-by: unsloth/Qwen3.8-27B-GGUF:Q4_K_M with pi.dev v1.4.0 Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
36978c55e2
commit
c5ad946d6e
1 changed files with 522 additions and 14 deletions
|
|
@ -286,4 +286,23 @@ sde = SuseDistro(
|
|||
assert asyncio.run(sde.pkg_files()) == []
|
||||
assert '--queryformat' in cl.cmds[-1]
|
||||
|
||||
# -- _install_local_files --
|
||||
|
||||
# -- With dependency resolution, the files go to the package manager;
|
||||
# DummyDistro._install() is a no-op
|
||||
asyncio.run(
|
||||
d._install_local_files(['/a/jw-base-run-1.0.0-42.rpm'], False, install_deps = True)
|
||||
)
|
||||
|
||||
# -- Without, the base implementation raises: there is no direct route
|
||||
try:
|
||||
asyncio.run(
|
||||
d._install_local_files(
|
||||
['/a/jw-base-run-1.0.0-42.rpm'], False, install_deps = False
|
||||
)
|
||||
)
|
||||
assert False, 'Should have raised'
|
||||
except NotImplementedError:
|
||||
pass
|
||||
|
||||
print('All Distro tests passed')
|
||||
|
|
|
|||
Loading…
Reference in a new issue