From 992139c75d5ee2b66bc71a832a6675e53f917b3b Mon Sep 17 00:00:00 2001 From: Ophestra Date: Sun, 19 Apr 2026 00:35:24 +0900 Subject: [PATCH] internal/rosa/python: extra script after install This is generally for test suite, due to the lack of standard or widely agreed upon convention. Signed-off-by: Ophestra --- internal/rosa/python.go | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/internal/rosa/python.go b/internal/rosa/python.go index 4af5c0ef..cfd2a22f 100644 --- a/internal/rosa/python.go +++ b/internal/rosa/python.go @@ -85,6 +85,10 @@ func init() { type PipHelper struct { // Whether to omit --no-build-isolation. BuildIsolation bool + // Whether to enter source after install. + EnterSource bool + // Runs after install. + Script string } var _ Helper = new(PipHelper) @@ -119,12 +123,18 @@ func (attr *PipHelper) script(name string) string { --no-build-isolation \` } + script := attr.Script + if attr.EnterSource { + script = "cd '/usr/src/" + name + "'\n" + script + } + return ` pip3 install \ --no-index \ --prefix=/system \ --root=/work \` + extra + ` - '/usr/src/` + name + `'` + '/usr/src/` + name + `' +` + script } // newViaPip installs a pip wheel from a url.