MCPcopy Index your code
hub / github.com/kivy/python-for-android / expand_dependencies

Function expand_dependencies

pythonforandroid/bootstrap.py:453–489  ·  view source on GitHub ↗

This function expands to lists of all different available alternative recipe combinations, with the dependencies added in ONLY for all the not-with-alternative recipes. (So this is like the deps graph very simplified and incomplete, but hopefully good enough for mos

(recipes, ctx)

Source from the content-addressed store, hash-verified

451
452
453def expand_dependencies(recipes, ctx):
454 """ This function expands to lists of all different available
455 alternative recipe combinations, with the dependencies added in
456 ONLY for all the not-with-alternative recipes.
457 (So this is like the deps graph very simplified and incomplete, but
458 hopefully good enough for most basic bootstrap compatibility checks)
459 """
460
461 # Add in all the deps of recipes where there is no alternative:
462 recipes_with_deps = list(recipes)
463 for entry in recipes:
464 if not isinstance(entry, (tuple, list)) or len(entry) == 1:
465 if isinstance(entry, (tuple, list)):
466 entry = entry[0]
467 try:
468 recipe = Recipe.get_recipe(entry, ctx)
469 recipes_with_deps += recipe.depends
470 except ValueError:
471 # it's a pure python package without a recipe, so we
472 # don't know the dependencies...skipping for now
473 pass
474
475 # Split up lists by available alternatives:
476 recipe_lists = [[]]
477 for recipe in recipes_with_deps:
478 if isinstance(recipe, (tuple, list)):
479 new_recipe_lists = []
480 for alternative in recipe:
481 for old_list in recipe_lists:
482 new_list = [i for i in old_list]
483 new_list.append(alternative)
484 new_recipe_lists.append(new_list)
485 recipe_lists = new_recipe_lists
486 else:
487 for existing_list in recipe_lists:
488 existing_list.append(recipe)
489 return recipe_lists

Calls 1

get_recipeMethod · 0.80