mirror of
https://github.com/httprunner/httprunner.git
synced 2026-09-06 07:57:27 +08:00
refactor: EnsurePython3Venv
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package scaffold
|
||||
|
||||
import (
|
||||
"path/filepath"
|
||||
"testing"
|
||||
)
|
||||
|
||||
@@ -12,7 +13,8 @@ func TestGenDemoExamples(t *testing.T) {
|
||||
}
|
||||
|
||||
dir = "../../../examples/demo-with-py-plugin"
|
||||
err = CreateScaffold(dir, Py, "", true)
|
||||
venv := filepath.Join(dir, ".venv")
|
||||
err = CreateScaffold(dir, Py, venv, true)
|
||||
if err != nil {
|
||||
t.Fatal()
|
||||
}
|
||||
|
||||
@@ -205,14 +205,6 @@ func createPythonPlugin(projectName, venv string) error {
|
||||
return errors.Wrap(err, "copy file failed")
|
||||
}
|
||||
|
||||
if venv == "" {
|
||||
home, err := os.UserHomeDir()
|
||||
if err != nil {
|
||||
return errors.Wrap(err, "get user home dir failed")
|
||||
}
|
||||
venv = filepath.Join(home, ".hrp", "venv")
|
||||
}
|
||||
log.Info().Str("venv", venv).Msg("create python3 venv")
|
||||
packages := []string{
|
||||
fmt.Sprintf("funppy==%s", fungo.Version),
|
||||
fmt.Sprintf("httprunner==%s", version.VERSION),
|
||||
|
||||
Reference in New Issue
Block a user