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
|
BuildIsolation bool
|
||||||
// Whether to enter source after install.
|
// Whether to enter source after install.
|
||||||
EnterSource bool
|
EnterSource bool
|
||||||
|
// Whether to install to build environment after install.
|
||||||
|
Install bool
|
||||||
// Runs after install.
|
// Runs after install.
|
||||||
Script string
|
Script string
|
||||||
}
|
}
|
||||||
@@ -144,6 +146,7 @@ func (attr *PipHelper) script(name string) string {
|
|||||||
if attr == nil {
|
if attr == nil {
|
||||||
attr = new(PipHelper)
|
attr = new(PipHelper)
|
||||||
}
|
}
|
||||||
|
sourcePath := AbsUsrSrc.Append(name).Append(attr.Append...)
|
||||||
|
|
||||||
var extra string
|
var extra string
|
||||||
if !attr.BuildIsolation {
|
if !attr.BuildIsolation {
|
||||||
@@ -152,6 +155,14 @@ func (attr *PipHelper) script(name string) string {
|
|||||||
}
|
}
|
||||||
|
|
||||||
script := attr.Script
|
script := attr.Script
|
||||||
|
if attr.Install {
|
||||||
|
script = `pip3 install \
|
||||||
|
--no-index \
|
||||||
|
--prefix=/system \
|
||||||
|
--no-build-isolation \
|
||||||
|
'` + sourcePath.String() + `'
|
||||||
|
` + script
|
||||||
|
}
|
||||||
if attr.EnterSource {
|
if attr.EnterSource {
|
||||||
script = "cd '/usr/src/" + name + "'\n" + script
|
script = "cd '/usr/src/" + name + "'\n" + script
|
||||||
}
|
}
|
||||||
@@ -161,7 +172,7 @@ pip3 install \
|
|||||||
--no-index \
|
--no-index \
|
||||||
--prefix=/system \
|
--prefix=/system \
|
||||||
--root=/work \` + extra + `
|
--root=/work \` + extra + `
|
||||||
'` + AbsUsrSrc.Append(name).Append(attr.Append...).String() + `'
|
'` + sourcePath.String() + `'
|
||||||
` + script
|
` + script
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user