internal/rosa/python: optionally install before check
All checks were successful
Test / Create distribution (push) Successful in 1m1s
Test / Sandbox (push) Successful in 2m52s
Test / ShareFS (push) Successful in 3m27s
Test / Sandbox (race detector) (push) Successful in 4m50s
Test / Hakurei (race detector) (push) Successful in 6m25s
Test / Hakurei (push) Successful in 2m43s
Test / Flake checks (push) Successful in 1m23s
All checks were successful
Test / Create distribution (push) Successful in 1m1s
Test / Sandbox (push) Successful in 2m52s
Test / ShareFS (push) Successful in 3m27s
Test / Sandbox (race detector) (push) Successful in 4m50s
Test / Hakurei (race detector) (push) Successful in 6m25s
Test / Hakurei (push) Successful in 2m43s
Test / Flake checks (push) Successful in 1m23s
Some test suites require package to be installed globally. Signed-off-by: Ophestra <cat@gensokyo.uk>
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user