Skip to content

Commit

Permalink
Remove python dep (konveyor#405)
Browse files Browse the repository at this point in the history
remove python dep

Signed-off-by: Emily McMullan <[email protected]>
  • Loading branch information
eemcmullan authored Dec 13, 2024
1 parent 62ef6af commit d1d0c6b
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 31 deletions.
26 changes: 1 addition & 25 deletions cmd/analyze-bin.go
Original file line number Diff line number Diff line change
Expand Up @@ -226,31 +226,7 @@ func (a *analyzeCommand) RunAnalysisContainerless(ctx context.Context) error {
}

func (a *analyzeCommand) ValidateContainerless(ctx context.Context) error {
// validate mvn, python, and openjdk install
// windows does not use python3 as executable name
if runtime.GOOS == "windows" {
cmd := exec.Command("python", "--version")
output, err := cmd.Output()
if err != nil {
return fmt.Errorf("%w cannot execute required command python; ensure python is installed", err)
}
version := strings.TrimSpace(string(output))
pythonVersionStr := strings.Split(version, " ")
versionStr := strings.Split(pythonVersionStr[1], ".")
versionInt, err := strconv.Atoi(versionStr[0])
if err != nil {
return fmt.Errorf("%w cannot parse python version", err)
}
if versionInt < 3 {
return fmt.Errorf("%w cannot find requirement python3; ensure python3 is installed", err)
}
} else {
_, pythonErr := exec.LookPath("python3")
if pythonErr != nil {
return fmt.Errorf("%w cannot find requirement python3; ensure python3 is installed", pythonErr)

}
}
// validate mvn and openjdk install
_, mvnErr := exec.LookPath("mvn")
if mvnErr != nil {
return fmt.Errorf("%w cannot find requirement maven; ensure maven is installed", mvnErr)
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -71,8 +71,8 @@ require (
github.com/codingconcepts/env v0.0.0-20200821220118-a8fbf8d84482
github.com/fabianvf/windup-rulesets-yaml v0.5.3
github.com/inconshreveable/mousetrap v1.1.0 // indirect
github.com/konveyor/analyzer-lsp v0.6.0-beta.1.0.20241203211117-7b4c586939e8
github.com/konveyor/analyzer-lsp/external-providers/java-external-provider v0.0.0-20241203211117-7b4c586939e8
github.com/konveyor/analyzer-lsp v0.6.0-beta.1.0.20241213191020-b49d6a41aa43
github.com/konveyor/analyzer-lsp/external-providers/java-external-provider v0.0.0-20241213191020-b49d6a41aa43
github.com/shopspring/decimal v1.3.1 // indirect
github.com/sirupsen/logrus v1.9.3
github.com/spf13/pflag v1.0.5 // indirect
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -82,10 +82,10 @@ github.com/josharian/intern v1.0.0 h1:vlS4z54oSdjm0bgjRigI+G1HpF+tI+9rE5LLzOg8Hm
github.com/josharian/intern v1.0.0/go.mod h1:5DoeVV0s6jJacbCEi61lwdGj/aVlrQvzHFFd8Hwg//Y=
github.com/kisielk/errcheck v1.5.0/go.mod h1:pFxgyoBC7bSaBwPgfKdkLd5X25qrDl4LWUI2bnpBCr8=
github.com/kisielk/gotool v1.0.0/go.mod h1:XhKaO+MFFWcvkIS/tQcRk01m1F5IRFswLeQ+oQHNcck=
github.com/konveyor/analyzer-lsp v0.6.0-beta.1.0.20241203211117-7b4c586939e8 h1:xaOKsJ4AB17LnnsvNthrpScyaf73FMBPqoApOyQd5/k=
github.com/konveyor/analyzer-lsp v0.6.0-beta.1.0.20241203211117-7b4c586939e8/go.mod h1:l9XC3uazLba8yXoAFJWN7uBDju1s/g1Hc8TKBpE3B2U=
github.com/konveyor/analyzer-lsp/external-providers/java-external-provider v0.0.0-20241203211117-7b4c586939e8 h1:6GIfLM6Xh4EoFwHmgnBz8w0NlwZKBlVKyPrytp6p1GI=
github.com/konveyor/analyzer-lsp/external-providers/java-external-provider v0.0.0-20241203211117-7b4c586939e8/go.mod h1:0OaNuH9HgJZbXPKmblcAfJ+4qyuS5Rc0dp3kmMvjtKk=
github.com/konveyor/analyzer-lsp v0.6.0-beta.1.0.20241213191020-b49d6a41aa43 h1:xQq6hqT2jkz/y+nDGTTltQ6ckz65UZfk7WPkBrgjA0o=
github.com/konveyor/analyzer-lsp v0.6.0-beta.1.0.20241213191020-b49d6a41aa43/go.mod h1:l9XC3uazLba8yXoAFJWN7uBDju1s/g1Hc8TKBpE3B2U=
github.com/konveyor/analyzer-lsp/external-providers/java-external-provider v0.0.0-20241213191020-b49d6a41aa43 h1:BlUtDOY6tXwTsNpEvVsEE09WPirTX6xtE7Br/EVVJjc=
github.com/konveyor/analyzer-lsp/external-providers/java-external-provider v0.0.0-20241213191020-b49d6a41aa43/go.mod h1:9hR5THTSExZSAPz8uDEVgm2gm47F8gqFj8cU9K/d32M=
github.com/kr/pretty v0.1.0/go.mod h1:dAy3ld7l9f0ibDNOQOHHMYYIIbhfbHSm3C4ZsoJORNo=
github.com/kr/pretty v0.3.1 h1:flRD4NNwYAUpkphVc1HcthR4KEIFJ65n8Mw5qdRn3LE=
github.com/kr/pretty v0.3.1/go.mod h1:hoEshYVHaxMs3cyo3Yncou5ZscifuDolrwPKZanG3xk=
Expand Down

0 comments on commit d1d0c6b

Please sign in to comment.