Skip to content

Commit

Permalink
feat: Add PyPI as the default index in PackageFinder
Browse files Browse the repository at this point in the history
Signed-off-by: Frost Ming <me@frostming.com>
  • Loading branch information
frostming committed Jan 3, 2024
1 parent 0646689 commit 7d1c215
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/unearth/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ def cli(argv: list[str] | None = None) -> None:
name = args.requirement.name
target_python = TargetPython(args.py_ver, args.abis, args.impl, args.platforms)
finder = PackageFinder(
index_urls=args.index_urls or ["https://pypi.org/simple/"],
index_urls=args.index_urls or [],
find_links=args.find_links or [],
trusted_hosts=args.trusted_hosts or [],
target_python=target_python,
Expand Down
3 changes: 3 additions & 0 deletions src/unearth/finder.py
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,9 @@ def __init__(
self.add_index_url(url)
for url in find_links:
self.add_find_links(url)
# Add PyPI as the default index.
if not self.sources:
self.add_index_url("https://pypi.org/simple/")
self.target_python = target_python or TargetPython()
self.ignore_compatibility = ignore_compatibility
self.no_binary = {canonicalize_name(name) for name in no_binary}
Expand Down

0 comments on commit 7d1c215

Please sign in to comment.