def find_matches(self, req): all = self.deps_db.available_versions(req.key) matching_versions = filter_versions(all, req.specs) return [ Candidate(name=req.name, ver=ver, extras=req.extras) for ver in matching_versions ]
def find_matches(self, req): all = self.deps_db.available_versions(req.key) def sort_key(ver): return self.sort_key(req.key, ver) version_matches = sorted(filter_versions(all, req.specs), key=lambda x: sort_key(x)) return [Candidate(name=req.name, ver=ver, extras=req.extras) for ver in version_matches]
def _python_requires_ok(self, wheel: WheelRelease): if not wheel.requires_python: return True ver = parse('.'.join(self.py_ver_digits)) try: parsed_py_requires = list(parse_reqs(f"python{wheel.requires_python}")) return bool(filter_versions([ver], parsed_py_requires[0].specs)) except RequirementParseError: print(f"WARNING: `requires_python` attribute of wheel {wheel.name}:{wheel.ver} could not be parsed") return False
def is_satisfied_by(self, requirement, candidate): if not set(requirement.extras).issubset(set(candidate.extras)): return False return bool( len(list(filter_versions([candidate.ver], requirement.specs))))