Skip to content

Commit

Permalink
Install dependencies before the depending.
Browse files Browse the repository at this point in the history
This appears to be a fix for a regression vs master, as it passes tests.  I
found the issue when working on setup-requires, as in that case a failure
doesn't just break after pip completes, but actually causes the pip invocation
to fail. See issue 2260 in the discussion where its stated that installing
deps first is desired.
  • Loading branch information
rbtcollins committed Mar 24, 2015
1 parent 47963ae commit 81e091e
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions pip/req/req_set.py
Original file line number Diff line number Diff line change
Expand Up @@ -506,6 +506,13 @@ def _prepare_file(self, finder, req_to_install):
dist = abstract_dist.dist(finder)
more_reqs = []

# We add req_to_install before its dependencies, so that when
# to_install is calculated, which reverses the order,
# req_to_install is installed after its dependencies.
if not self.has_requirement(req_to_install.name):
# 'unnamed' requirements will get added here
self.add_requirement(req_to_install)

if not self.ignore_dependencies:
if (req_to_install.extras):
logger.debug(
Expand Down Expand Up @@ -536,10 +543,6 @@ def _prepare_file(self, finder, req_to_install):
more_reqs.append(subreq)
self.add_requirement(subreq)

if not self.has_requirement(req_to_install.name):
# 'unnamed' requirements will get added here
self.add_requirement(req_to_install)

# cleanup tmp src
self.reqs_to_cleanup.append(req_to_install)

Expand Down

0 comments on commit 81e091e

Please sign in to comment.