Skip to content

Commit 37515da

Browse files
committed
Separated pip install targets from local recipes in graph
1 parent 13d5d20 commit 37515da

File tree

2 files changed

+24
-10
lines changed

2 files changed

+24
-10
lines changed

pythonforandroid/bootstrap.py

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -150,9 +150,14 @@ def get_bootstrap_from_recipes(cls, recipes, ctx):
150150
ok = False
151151
break
152152
for recipe in recipes:
153-
recipe = Recipe.get_recipe(recipe, ctx)
153+
try:
154+
recipe = Recipe.get_recipe(recipe, ctx)
155+
except IOError:
156+
conflicts = []
157+
else:
158+
conflicts = recipe.conflicts
154159
if any([conflict in possible_dependencies
155-
for conflict in recipe.conflicts]):
160+
for conflict in conflicts]):
156161
ok = False
157162
break
158163
if ok:

pythonforandroid/graph.py

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ def conflicts(self, name):
127127
try:
128128
recipe = Recipe.get_recipe(name, self.ctx)
129129
conflicts = recipe.conflicts
130-
except OSError:
130+
except IOError:
131131
conflicts = []
132132

133133
if any([c in self for c in conflicts]):
@@ -152,7 +152,7 @@ def recursively_collect_orders(name, ctx, orders=[]):
152152
conflicts = []
153153
else:
154154
conflicts = recipe.conflicts
155-
except OSError:
155+
except IOError:
156156
# The recipe does not exist, so we assume it can be installed
157157
# via pip with no extra dependencies
158158
dependencies = []
@@ -209,8 +209,8 @@ def get_recipe_order_and_bootstrap(ctx, names, bs=None):
209209

210210
possible_orders = []
211211

212-
# get all possible recipe sets if names includes alternative
213-
# dependencies
212+
# get all possible order graphs, as names may include tuples/lists
213+
# of alternative dependencies
214214
names = [([name] if not isinstance(name, (list, tuple)) else name)
215215
for name in names]
216216
for name_set in product(*names):
@@ -258,11 +258,20 @@ def get_recipe_order_and_bootstrap(ctx, names, bs=None):
258258

259259
if bs is None:
260260
bs = Bootstrap.get_bootstrap_from_recipes(chosen_order, ctx)
261-
chosen_order, bs = get_recipe_order_and_bootstrap(ctx, chosen_order, bs=bs)
262-
263-
return chosen_order, bs
264-
261+
recipes, python_modules, bs = get_recipe_order_and_bootstrap(ctx, chosen_order, bs=bs)
262+
else:
263+
# check if each requirement has a recipe
264+
recipes = []
265+
python_modules = []
266+
for name in chosen_order:
267+
try:
268+
recipe = Recipe.get_recipe(name, ctx)
269+
except IOError:
270+
python_modules.append(name)
271+
else:
272+
recipes.append(name)
265273

274+
return recipes, python_modules, bs
266275

267276

268277
# def get_recipe_order_and_bootstrap(ctx, names, bs=None):

0 commit comments

Comments
 (0)