- # first try to find a platform-dependent dist
- for allow_platform_independent in (False, True):
- for dist in env[req.key]:
- if dist.precedence==DEVELOP_DIST and not develop_ok:
- if dist not in skipped:
- self.warn("Skipping development or system egg: %s",dist)
- skipped[dist] = 1
- continue
-
- if (dist in req and (allow_platform_independent or dist.platform is not None) and
- (dist.precedence<=SOURCE_DIST or not source)):
- return dist
+ # first try to find a local dist
+ for allow_remote in (False, True):
+ # then try to find a platform-dependent dist
+ for allow_platform_independent in (False, True):
+ for dist in env[req.key]:
+ if dist.precedence==DEVELOP_DIST and not develop_ok:
+ if dist not in skipped:
+ self.warn("Skipping development or system egg: %s",dist)
+ skipped[dist] = 1
+ continue
+
+ if ((is_local(dist.location) or allow_remote) and
+ (dist in req) and
+ ((allow_platform_independent or dist.platform is not None) and
+ (dist.precedence<=SOURCE_DIST or not source))):
+ return dist