internal/rosa/python: extra script after install
All checks were successful
Test / Create distribution (push) Successful in 1m5s
Test / Sandbox (push) Successful in 2m49s
Test / Hakurei (push) Successful in 3m47s
Test / ShareFS (push) Successful in 3m52s
Test / Sandbox (race detector) (push) Successful in 5m20s
Test / Hakurei (race detector) (push) Successful in 6m24s
Test / Flake checks (push) Successful in 1m21s

This is generally for test suite, due to the lack of standard or widely agreed upon convention.

Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
2026-04-19 00:35:24 +09:00
parent 57c69b533e
commit 992139c75d

View File

@@ -85,6 +85,10 @@ func init() {
type PipHelper struct { type PipHelper struct {
// Whether to omit --no-build-isolation. // Whether to omit --no-build-isolation.
BuildIsolation bool BuildIsolation bool
// Whether to enter source after install.
EnterSource bool
// Runs after install.
Script string
} }
var _ Helper = new(PipHelper) var _ Helper = new(PipHelper)
@@ -119,12 +123,18 @@ func (attr *PipHelper) script(name string) string {
--no-build-isolation \` --no-build-isolation \`
} }
script := attr.Script
if attr.EnterSource {
script = "cd '/usr/src/" + name + "'\n" + script
}
return ` return `
pip3 install \ pip3 install \
--no-index \ --no-index \
--prefix=/system \ --prefix=/system \
--root=/work \` + extra + ` --root=/work \` + extra + `
'/usr/src/` + name + `'` '/usr/src/` + name + `'
` + script
} }
// newViaPip installs a pip wheel from a url. // newViaPip installs a pip wheel from a url.