Skip to content

Commit

Permalink
Ensuring that non-poetry backends don't suggest themselves when poetry
Browse files Browse the repository at this point in the history
  • Loading branch information
blast-hardcheese committed Aug 30, 2024
1 parent 295a927 commit a40da7e
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion internal/backends/python/python.go
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,14 @@ func makePythonPipBackend() api.LanguageBackend {
b := api.LanguageBackend{
Name: "python3-pip",
Specfile: "requirements.txt",
IsSpecfileCompatible: func(path string) (bool, error) {
cfg, err := readPyproject()
if err != nil {
return false, err
}

return cfg.Tool.Poetry == nil, nil
},
IsAvailable: func() bool {
_, err := exec.LookPath("pip")
return err == nil
Expand Down Expand Up @@ -729,7 +737,7 @@ func makePythonUvBackend() api.LanguageBackend {
return false, err
}

return cfg.BuildSystem.BuildBackend == "hatchling.build", nil
return cfg.Tool.Poetry == nil, nil
},
Lockfile: "uv.lock",
IsAvailable: func() bool {
Expand Down

0 comments on commit a40da7e

Please sign in to comment.