Skip to content

Commit de3061a

Browse files
committed
pip as default + static
1 parent ce8778c commit de3061a

File tree

2 files changed

+7
-5
lines changed

2 files changed

+7
-5
lines changed

commands/audit/sca/python/python.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,8 +103,10 @@ func getDependencies(params xrayutils2.AuditParams) (dependenciesGraph map[strin
103103
err = errors.New("no technology was provided")
104104
return
105105
}
106-
pythonTool := pythonutils.PythonTool(params.Technologies()[0])
107-
106+
pythonTool := pythonutils.Pip
107+
if len(params.Technologies()) > 0 {
108+
pythonTool = pythonutils.PythonTool(params.Technologies()[0])
109+
}
108110
if !params.SkipAutoInstall() {
109111
restoreEnv, restoreEnvErr := runPythonInstall(params, pythonTool)
110112
defer func() {

commands/audit/sca/python/python_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -218,7 +218,7 @@ func TestSkipBuildDepTreeWhenInstallForbidden(t *testing.T) {
218218
shouldBeInstalled bool
219219
successfulTreeBuiltExpected bool
220220
}{
221-
//pip
221+
// pip
222222
{
223223
name: "not installed | install required - install command",
224224
testDir: filepath.Join("projects", "package-managers", "python", "pip", "pip", "requirementsproject"),
@@ -242,7 +242,7 @@ func TestSkipBuildDepTreeWhenInstallForbidden(t *testing.T) {
242242
successfulTreeBuiltExpected: true,
243243
},
244244

245-
//pipenv
245+
// pipenv
246246
{
247247
name: "not installed | install required - install command",
248248
testDir: filepath.Join("projects", "package-managers", "python", "pipenv", "pipenv", "pipenvproject"),
@@ -266,7 +266,7 @@ func TestSkipBuildDepTreeWhenInstallForbidden(t *testing.T) {
266266
successfulTreeBuiltExpected: true,
267267
},
268268

269-
//poetry
269+
// poetry
270270
{
271271
name: "not installed | install required - install command",
272272
testDir: filepath.Join("projects", "package-managers", "poetry", "poetry"),

0 commit comments

Comments
 (0)