From 5c2c40785a8def0bb0439babb1724351d15c7abb Mon Sep 17 00:00:00 2001 From: Sauhard Gupta Date: Fri, 26 Oct 2018 17:29:49 +0100 Subject: [PATCH] Fix PackageFinder to respect allow_all_prereleases --- src/pip/_internal/index.py | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/pip/_internal/index.py b/src/pip/_internal/index.py index 876fff2213f..cd88ac4642c 100644 --- a/src/pip/_internal/index.py +++ b/src/pip/_internal/index.py @@ -613,10 +613,11 @@ def find_all_candidates(self, project_name): ) # This is an intentional priority ordering - return ( - file_versions + find_links_versions + page_versions + - dependency_versions - ) + all_candidates = file_versions + find_links_versions + page_versions + dependency_versions + if (not self.allow_all_prereleases): + all_candidates = [candidate for candidate in all_candidates + if not candidate.version.is_prerelease] + return (all_candidates) def find_requirement(self, req, upgrade): """Try to find a Link matching req