Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Warn when dropping index URL value to directory #5836

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions news/5827.feature
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
A warning message is emitted when dropping an ``--[extra-]index-url`` value that points to an existing local directory.
5 changes: 5 additions & 0 deletions src/pip/_internal/index.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,6 +216,11 @@ def sort_path(path):
sort_path(os.path.join(path, item))
elif is_file_url:
urls.append(url)
else:
logger.warning(
"Path '{0}' is ignored: "
"it is a directory.".format(path),
)
elif os.path.isfile(path):
sort_path(path)
else:
Expand Down