change: hrp install httprunner v4

This commit is contained in:
debugtalk
2022-04-25 18:36:24 +08:00
parent f5ff03d346
commit 1a1016bc37
7 changed files with 15 additions and 7 deletions

View File

@@ -86,7 +86,7 @@ func EnsurePython3Venv(packages ...string) (string, error) {
venvDir := filepath.Join(home, ".hrp", "venv")
python3, err := shared.EnsurePython3Venv(venvDir, packages...)
if err != nil {
return "", errors.Wrap(err, "ensure python venv failed")
return "", errors.Wrap(err, "ensure python3 venv failed")
}
return python3, nil

View File

@@ -10,6 +10,7 @@ import (
"github.com/httprunner/httprunner/hrp"
"github.com/httprunner/httprunner/hrp/internal/builtin"
"github.com/httprunner/httprunner/hrp/internal/sdk"
"github.com/httprunner/httprunner/hrp/internal/version"
)
func Convert2TestScripts(destType string, paths ...string) error {
@@ -28,7 +29,8 @@ func Convert2TestScripts(destType string, paths ...string) error {
}
func convert2PyTestScripts(paths ...string) error {
python3, err := builtin.EnsurePython3Venv("httprunner")
httprunner := fmt.Sprintf("httprunner>=%s", version.HttpRunnerMinVersion)
python3, err := builtin.EnsurePython3Venv(httprunner)
if err != nil {
return err
}

View File

@@ -1,8 +1,11 @@
package pytest
import (
"fmt"
"github.com/httprunner/httprunner/hrp/internal/builtin"
"github.com/httprunner/httprunner/hrp/internal/sdk"
"github.com/httprunner/httprunner/hrp/internal/version"
)
func RunPytest(args []string) error {
@@ -11,7 +14,8 @@ func RunPytest(args []string) error {
Action: "hrp pytest",
})
python3, err := builtin.EnsurePython3Venv("httprunner")
httprunner := fmt.Sprintf("httprunner>=%s", version.HttpRunnerMinVersion)
python3, err := builtin.EnsurePython3Venv(httprunner)
if err != nil {
return err
}

View File

@@ -185,7 +185,7 @@ func createPythonPlugin(projectName string) error {
return errors.Wrap(err, "copy file failed")
}
_, err = builtin.EnsurePython3Venv(fmt.Sprintf("funppy==%s", shared.Version))
_, err = builtin.EnsurePython3Venv(fmt.Sprintf("funppy>=%s", shared.Version))
if err != nil {
return err
}

View File

@@ -6,3 +6,5 @@ import (
//go:embed VERSION
var VERSION string
const HttpRunnerMinVersion = "v4.0.0-beta"