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 Sep 1, 2024
1 parent 295a927 commit 2e14ea3
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 true, 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 && cfg.BuildSystem.BuildBackend == "hatchling.build", nil
},
Lockfile: "uv.lock",
IsAvailable: func() bool {
Expand Down

0 comments on commit 2e14ea3

Please sign in to comment.