pipenv
pipenv copied to clipboard
Fix extra indexes
The issue
When installing a requirement that explicitly references an index all indexes are searched even though install_search_all_sources = False
.
The fix
There were two different locations where the code appears to not have the expected behavior.
The checklist
- [ ] Associated issue
- [ ] A news fragment in the
news/
directory to describe this fix with the extension.bugfix
,.feature
,.behavior
,.doc
..vendor
. or.trivial
(this will appear in the release changelog). Use semantic line breaks and name the file after the issue number or the PR #.
This seems like a good improvement, but I still would like to get a second opinion from @matteius . Could you please also add a news file?
@aronbierbaum I am not sure why earlier I could not get that second test failure, because I was able to reproduce it now. I think this would be a good way the fix the other test, since we showed both methods here, one where we rely on index restrictions, and this test where we allow all indexes to be searched:
diff --git a/tests/integration/test_install_uri.py b/tests/integration/test_install_uri.py
index f21da0f4..470274ef 100644
--- a/tests/integration/test_install_uri.py
+++ b/tests/integration/test_install_uri.py
@@ -209,6 +209,9 @@ name = "pypi"
six = "*"
[dev-packages]
+
+[pipenv]
+install_search_all_sources = true
""".strip()
f.write(contents)
c = p.pipenv("install pipenv-test-private-package --index https://test.pypi.org/simple")
@aronbierbaum Thanks for this fix! :+1: I've been pulling hairs for hours trying to understand why pipenv is installing the public "utils" package instead of my private one. You're awesome man! :1st_place_medal: