change: create python3 plugin venv with latest funppy/httprunner

This commit is contained in:
lilong.129
2023-08-20 14:09:37 +08:00
parent b5c8a98ed2
commit c2935cf1a6
8 changed files with 13 additions and 31 deletions

View File

@@ -1,7 +1,6 @@
package cmd
import (
"fmt"
"io/ioutil"
"path/filepath"
@@ -12,7 +11,6 @@ import (
"github.com/httprunner/httprunner/v4/hrp/internal/builtin"
"github.com/httprunner/httprunner/v4/hrp/internal/code"
"github.com/httprunner/httprunner/v4/hrp/internal/version"
"github.com/httprunner/httprunner/v4/hrp/pkg/convert"
)
@@ -42,9 +40,7 @@ var convertCmd = &cobra.Command{
if toYAMLFlag {
outputType = convert.OutputTypeYAML
} else if toPyTestFlag {
packages := []string{
fmt.Sprintf("httprunner==%s", version.HttpRunnerMinimumVersion),
}
packages := []string{"httprunner"}
_, err := myexec.EnsurePython3Venv(venv, packages...)
if err != nil {
log.Error().Err(err).Msg("python3 venv is not ready")

View File

@@ -1,7 +1,6 @@
package cmd
import (
"fmt"
"strings"
"time"
@@ -13,7 +12,6 @@ import (
"github.com/httprunner/httprunner/v4/hrp/internal/code"
"github.com/httprunner/httprunner/v4/hrp/internal/pytest"
"github.com/httprunner/httprunner/v4/hrp/internal/sdk"
"github.com/httprunner/httprunner/v4/hrp/internal/version"
)
var pytestCmd = &cobra.Command{
@@ -31,9 +29,7 @@ var pytestCmd = &cobra.Command{
})
}()
packages := []string{
fmt.Sprintf("httprunner==%s", version.HttpRunnerMinimumVersion),
}
packages := []string{"httprunner"}
_, err = myexec.EnsurePython3Venv(venv, packages...)
if err != nil {
log.Error().Err(err).Msg("python3 venv is not ready")

View File

@@ -7,7 +7,6 @@ import (
"path/filepath"
"time"
"github.com/httprunner/funplugin/fungo"
"github.com/httprunner/funplugin/myexec"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
@@ -211,10 +210,7 @@ func createPythonPlugin(projectName, venv string) error {
return errors.Wrap(err, "copy file failed")
}
packages := []string{
fmt.Sprintf("funppy==%s", fungo.Version),
fmt.Sprintf("httprunner==%s", version.HttpRunnerMinimumVersion),
}
packages := []string{"funppy", "httprunner"}
_, err = myexec.EnsurePython3Venv(venv, packages...)
if err != nil {
return errors.Wrap(code.InvalidPython3Venv, err.Error())

View File

@@ -6,6 +6,3 @@ import (
//go:embed VERSION
var VERSION string
// httprunner python version
const HttpRunnerMinimumVersion = "v4.3.5"

View File

@@ -1,14 +1,12 @@
package hrp
import (
"fmt"
"os"
"path/filepath"
"strings"
"sync"
"github.com/httprunner/funplugin"
"github.com/httprunner/funplugin/fungo"
"github.com/httprunner/funplugin/myexec"
"github.com/pkg/errors"
"github.com/rs/zerolog/log"
@@ -65,9 +63,7 @@ func initPlugin(path, venv string, logOn bool) (plugin funplugin.IPlugin, err er
}
pluginPath = genPyPluginPath
packages := []string{
fmt.Sprintf("funppy==%s", fungo.Version),
}
packages := []string{"funppy"}
python3, err := myexec.EnsurePython3Venv(venv, packages...)
if err != nil {
log.Error().Err(err).