def _schedule_default_packages_solver_jobs(packages: List[str], index_urls: List[str]) -> int: """Run solver jobs for Python packages list selected.""" openshift = OpenShift() counter = 0 for index_url in index_urls: _LOGGER.debug("consider index %r", index_url) source = Source(index_url) for package_name in packages: _LOGGER.debug("Obtaining %r versions", package_name) versions = [] try: versions = source.get_package_versions(package_name) except Exception as exc: _LOGGER.exception(str(exc)) if versions: for version in versions: _LOGGER.info( "Scheduling package_name %r in package_version %r", package_name, version) number_workflows = _do_schedule_solver_jobs( openshift, index_urls, package_name, version) counter += number_workflows _LOGGER.info(f"Already scheduled {counter} solver workflows...") return counter
def main() -> None: """Obtain symbols provided by TensorFlow in various releases.""" pypi = Source("https://pypi.org/simple") os.makedirs("data", exist_ok=True) for tensorflow_version in pypi.get_package_versions("tensorflow"): print( f"Obtaining info for TensorFlow in version {tensorflow_version!r}") artifacts = [ a for a in pypi.get_package_artifacts("tensorflow", tensorflow_version) if "manylinux" in a.artifact_name ] if len(artifacts) == 0: print( f"!!! no artifacts to download for TensorFlow in version {tensorflow_version}" ) continue artifacts[0]._extract_py_module() symbols = gather_symbols_provided(artifacts[0].dir_name, ignore_errors=True) with open(f"data/tensorflow-{tensorflow_version}.json", "w") as f: json.dump(symbols, f, sort_keys=True, indent=2)