def _dump_req(self, req): self.debug(" - Fetching requirement: %s" % req) fetched_egg = self._fetcher.fetch(req) if fetched_egg is None: print("ERROR: Could not find %s!" % req, file=sys.stderr) else: if fetched_egg.endswith(".egg"): self._dump_egg(PythonDependency.from_eggs(fetched_egg)) self.cache_egg_if_necessary(fetched_egg) else: if self._index is None: self.debug("ERROR: Could not contact any indices! Your application may not " "work properly.") return self.debug(" => Building %s" % fetched_egg) distributions = ReqBuilder.install_requirement(fetched_egg, index=self._index, repositories=self._repos) if not distributions: print("WARNING: Unable to build a working distribution from %s!" % fetched_egg, file=sys.stderr) print("Your application may not work properly.", file=sys.stderr) else: for distribution in distributions: if distribution.location.endswith(".egg"): self.cache_egg_if_necessary(distribution.location) self._dump_distribution(distribution)
def from_req(requirement): dists = ReqBuilder.install_requirement(requirement) return PythonDependency.from_distributions(*list(dists))
def from_source(filename): if not os.path.exists(filename): raise PythonDependency.NotFoundError("Could not find PythonDependency target %s!" % filename) dists = ReqBuilder.install_requirement(filename) return PythonDependency.from_distributions(*list(dists))
def from_req(requirement, interpreter=PythonInterpreter.get(), **kw): dists = ReqBuilder.install_requirement(requirement, interpreter=interpreter, **kw) return PythonDependency.from_distributions(*list(dists))