Skip to content

Commit

Permalink
Fix pipenv Test
Browse files Browse the repository at this point in the history
  • Loading branch information
sarao1310 committed Jul 31, 2023
1 parent b6cd190 commit 56d4b1d
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions utils/pythonutils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -258,7 +258,7 @@ func InstallWithLogParsing(tool PythonTool, commandArgs []string, log utils.Log,
if err != nil {
return nil, err
}
verifyPipEnvVersion := ver.Compare("2023.7.23") == 1 || ver.Compare("2023.7.23") == 0
verifyPipEnvVersion := ver.Compare("2023.7.23") == -1 || ver.Compare("2023.7.23") == 0
if tool == Pipenv && verifyPipEnvVersion {
_, stderr, _, err := gofrogcmd.RunCmdWithOutputParser(installCmd, true)
if err != nil {
Expand All @@ -275,7 +275,11 @@ func InstallWithLogParsing(tool PythonTool, commandArgs []string, log utils.Log,
} else {
fileName = filePath[lastSlashIndex+1:]
}
dependenciesMap[strings.ToLower(packageName)] = entities.Dependency{Id: fileName}
tempPackageName, err := GetPackageName(tool, filePath)
if err != nil {
return nil, err
}
dependenciesMap[strings.ToLower(tempPackageName)] = entities.Dependency{Id: fileName}
}
_, errorOut, _, err := gofrogcmd.RunCmdWithOutputParser(installCmd, true, &dependencyNameParser, &downloadedFileParser, &installedPackagesParser)
if err != nil {
Expand All @@ -300,6 +304,6 @@ func getPipEnvVersion() (*version.Version, error) {
if !found {
return nil, errors.New("couldn't find pipenv version")
}
versionData = strings.Replace(versionData, "\n", "", -1)
versionData = strings.ReplaceAll(versionData, "\n", "")
return version.NewVersion(versionData), nil
}

0 comments on commit 56d4b1d

Please sign in to comment.