Skip to content

Commit

Permalink
fix dependabot#8414 follow peotry source constraint
Browse files Browse the repository at this point in the history
  • Loading branch information
lucemia committed Nov 17, 2023
1 parent 9773166 commit 8ae784a
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
7 changes: 3 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,13 @@ 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"])
urls[:main] = source["url"]
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 8ae784a

Please sign in to comment.