From 39e4c5b8acf4abbf978a551ed7d608143722c618 Mon Sep 17 00:00:00 2001 From: Ophestra Date: Mon, 20 Apr 2026 01:25:43 +0900 Subject: [PATCH] internal/rosa/python: optionally install before check Some test suites require package to be installed globally. Signed-off-by: Ophestra --- internal/rosa/python.go | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/internal/rosa/python.go b/internal/rosa/python.go index 9fbace8b..02153794 100644 --- a/internal/rosa/python.go +++ b/internal/rosa/python.go @@ -115,6 +115,8 @@ type PipHelper struct { BuildIsolation bool // Whether to enter source after install. EnterSource bool + // Whether to install to build environment after install. + Install bool // Runs after install. Script string } @@ -144,6 +146,7 @@ func (attr *PipHelper) script(name string) string { if attr == nil { attr = new(PipHelper) } + sourcePath := AbsUsrSrc.Append(name).Append(attr.Append...) var extra string if !attr.BuildIsolation { @@ -152,6 +155,14 @@ func (attr *PipHelper) script(name string) string { } script := attr.Script + if attr.Install { + script = `pip3 install \ + --no-index \ + --prefix=/system \ + --no-build-isolation \ + '` + sourcePath.String() + `' +` + script + } if attr.EnterSource { script = "cd '/usr/src/" + name + "'\n" + script } @@ -161,7 +172,7 @@ pip3 install \ --no-index \ --prefix=/system \ --root=/work \` + extra + ` - '` + AbsUsrSrc.Append(name).Append(attr.Append...).String() + `' + '` + sourcePath.String() + `' ` + script }