1
0
mirror of https://github.com/SAP/jenkins-library.git synced 2025-09-16 09:26:22 +02:00
This commit is contained in:
Christopher Fenner
2025-09-12 15:39:05 +02:00
parent 96969818c2
commit fa6e0f5cbc
2 changed files with 12 additions and 12 deletions

View File

@@ -79,7 +79,7 @@ func runPythonBuild(config *pythonBuildOptions, telemetryData *telemetry.CustomD
if err := python.InstallBuild(virtualEnvPathMap["pip"], utils.RunExecutable); err != nil {
return fmt.Errorf("failed to install build module: %w", err)
}
if err := python.Build(utils.RunExecutable, python.Binary, config.BuildFlags, config.SetupFlags); err != nil {
if err := python.Build(virtualEnvPathMap["python"], utils.RunExecutable, config.BuildFlags, config.SetupFlags); err != nil {
return fmt.Errorf("failed to build python project: %w", err)
}
} else {
@@ -152,15 +152,15 @@ func createVirtualEnvironment(utils pythonBuildUtils, config *pythonBuildOptions
}
virutalEnvironmentPathMap["pip"] = filepath.Join(config.VirutalEnvironmentName, "bin", "pip")
// venv will create symlinks to python3 inside the container
virutalEnvironmentPathMap["python"] = "python"
virutalEnvironmentPathMap["python"] = filepath.Join(config.VirutalEnvironmentName, "bin", "python")
virutalEnvironmentPathMap["deactivate"] = filepath.Join(config.VirutalEnvironmentName, "bin", "deactivate")
if err = utils.RunExecutable("which", "python"); err != nil {
return err
}
if err = utils.RunExecutable("which", "pip"); err != nil {
return err
}
// if err = utils.RunExecutable("which", "python"); err != nil {
// return err
// }
// if err = utils.RunExecutable("which", "pip"); err != nil {
// return err
// }
return nil
}

View File

@@ -3,15 +3,15 @@ package python
import "github.com/SAP/jenkins-library/pkg/log"
func Build(
executeFn func(executable string, params ...string) error,
binary string,
executeFn func(executable string, params ...string) error,
binaryFlags []string,
moduleFlags []string,
) error {
// Set default value for binaryFlags if nil
if binaryFlags == nil {
binaryFlags = []string{}
}
// if binaryFlags == nil {
// binaryFlags = []string{}
// }
var flags []string
flags = append(flags, binaryFlags...)