Skip to content

Commit

Permalink
fix #8414 follow peotry source constraint (#8422)
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemia authored Nov 27, 2023
1 parent ada448d commit ef4ef5b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions python/lib/dependabot/python/update_checker/index_finder.rb
Original file line number Diff line number Diff line change
Expand Up @@ -123,14 +123,14 @@ def pyproject_index_urls
# If source is PyPI, skip it, and let it pick the default URI
next if source["name"].casecmp?("PyPI")

if source["default"]
if @dependency.all_sources.include?(source["name"])
# If dependency has specified this source, use it
return { main: source["url"], extra: [] }
elsif source["default"]
urls[:main] = source["url"]
elsif source["priority"] != "explicit"
# if source is not explicit, add it to extra
urls[:extra] << source["url"]
elsif @dependency.all_sources.include?(source["name"])
# if source is explicit, and dependency has specified it as a source, add it to extra
urls[:extra] << source["url"]
end
end
urls[:extra] = urls[:extra].uniq
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -352,7 +352,7 @@

it "gets the right index URLs" do
expect(index_urls).to match_array(
["https://pypi.org/simple/", "https://some.internal.registry.com/pypi/"]
["https://some.internal.registry.com/pypi/"]
)
end
end
Expand Down

0 comments on commit ef4ef5b

Please sign in to comment.