You've already forked sap-jenkins-library
mirror of
https://github.com/SAP/jenkins-library.git
synced 2025-09-16 09:26:22 +02:00
remove feature flag
This commit is contained in:
@@ -7,7 +7,6 @@ import (
|
|||||||
|
|
||||||
"github.com/SAP/jenkins-library/pkg/buildsettings"
|
"github.com/SAP/jenkins-library/pkg/buildsettings"
|
||||||
"github.com/SAP/jenkins-library/pkg/command"
|
"github.com/SAP/jenkins-library/pkg/command"
|
||||||
"github.com/SAP/jenkins-library/pkg/feature"
|
|
||||||
"github.com/SAP/jenkins-library/pkg/log"
|
"github.com/SAP/jenkins-library/pkg/log"
|
||||||
"github.com/SAP/jenkins-library/pkg/piperutils"
|
"github.com/SAP/jenkins-library/pkg/piperutils"
|
||||||
"github.com/SAP/jenkins-library/pkg/python"
|
"github.com/SAP/jenkins-library/pkg/python"
|
||||||
@@ -64,23 +63,22 @@ func runPythonBuild(config *pythonBuildOptions, telemetryData *telemetry.CustomD
|
|||||||
}
|
}
|
||||||
//TODO: use a defer func to cleanup the virtual environment
|
//TODO: use a defer func to cleanup the virtual environment
|
||||||
|
|
||||||
// FEATURE FLAG (com_sap_piper_featureFlag_pythonToml) to switch to new implementation of python build step
|
|
||||||
if feature.IsFeatureEnabled("pythonToml") {
|
|
||||||
// check project descriptor
|
// check project descriptor
|
||||||
buildDescriptorFilePath, err := searchDescriptor([]string{"pyproject.toml", "setup.py"}, utils.FileExists)
|
buildDescriptorFilePath, err := searchDescriptor([]string{"pyproject.toml", "setup.py"}, utils.FileExists)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
// build package
|
|
||||||
if strings.HasSuffix(buildDescriptorFilePath, "pyproject.toml") {
|
if strings.HasSuffix(buildDescriptorFilePath, "pyproject.toml") {
|
||||||
|
// TOML file
|
||||||
if err := python.InstallProjectDependencies(utils.RunExecutable, python.Binary); err != nil {
|
if err := python.InstallProjectDependencies(utils.RunExecutable, python.Binary); err != nil {
|
||||||
return fmt.Errorf("Failed to install project dependencies: %w", err)
|
return fmt.Errorf("Failed to install project dependencies: %w", err)
|
||||||
}
|
}
|
||||||
if err := python.Build(utils.RunExecutable, python.Binary, config.BuildFlags, config.SetupFlags); err != nil {
|
if err := python.Build(utils.RunExecutable, python.Binary, config.BuildFlags, config.SetupFlags); err != nil {
|
||||||
return fmt.Errorf("Failed to build python project: %w", err)
|
return fmt.Errorf("Failed to build python project: %w", err)
|
||||||
}
|
}
|
||||||
}
|
|
||||||
} else {
|
} else {
|
||||||
|
// legacy handling setup.py
|
||||||
if err := buildExecute(config, utils, virutalEnvironmentPathMap); err != nil {
|
if err := buildExecute(config, utils, virutalEnvironmentPathMap); err != nil {
|
||||||
return fmt.Errorf("Python build failed with error: %w", err)
|
return fmt.Errorf("Python build failed with error: %w", err)
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user