You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[revamp] Recipes can only depend on other recipes #449
Reading the code, this appears to be intentional, but is there scope for allowing recipes to depend on modules? I am trying to write a Twisted recipe, and it depends on zope.interface, which is a trivial Python module that requires no special treatment. But currently I have to make a trivial recipe for it; I am wondering if that should be necessary. One reason for requiring a recipe is that then e.g. tests can be stripped out, but maybe that could be reliably automated for Python modules?
I should be possible to depend on anything in pypi (which will then be automatically downloaded and installed if it's a pure python module), if that doesn't work then it's a bug. Does adding the pypi module name in the depends not work?
The Python module is correctly detected in get_recipe_order_and_bootstrap() at line 2245, but then in the subsequent call to graph.remove_remaining_conflicts() it blows up:
[INFO]: Loaded recipe twisted (depends on ['zope.interface'])
[INFO]: No recipe named zope.interface; will attempt to install with pip
Traceback (most recent call last):
File "/home/str4d/.local/bin/p4a", line 11, in <module>
sys.exit(ToolchainCL())
File "/home/str4d/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 2428, in __init__
getattr(self, args.command)(unknown)
File "/home/str4d/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 169, in wrapper_func
args = build_dist_from_args(ctx, dist, args)
File "/home/str4d/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 2202, in build_dist_from_args
build_order, python_modules, bs = get_recipe_order_and_bootstrap(ctx, dist.recipes, bs)
File "/home/str4d/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 2262, in get_recipe_order_and_bootstrap
graph.remove_remaining_conflicts(ctx)
File "/home/str4d/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 481, in remove_remaining_conflicts
recipe = Recipe.get_recipe(name, ctx)
File "/home/str4d/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py", line 1774, in get_recipe
mod = importlib.import_module("pythonforandroid.recipes.{}".format(name))
File "/usr/lib/python2.7/importlib/__init__.py", line 37, in import_module
__import__(name)
ImportError: No module named zope.interface
Okay, I guess recipes haven't ever depended on pypi modules before, so
it's a bug.
On 12/09/15 12:24, str4d wrote:
The Python module is correctly detected in
|get_recipe_order_and_bootstrap()| at line 2245, but then in the
subsequent call to |graph.remove_remaining_conflicts()| it blows up:
|[INFO]: Loaded recipe twisted (depends on ['zope.interface']) [INFO]: No
recipe named zope.interface; will attempt to install with pip Traceback
(most recent call last): File "/home/str4d/.local/bin/p4a", line 11, in
sys.exit(ToolchainCL()) File
"/home/str4d/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py",
line 2428, in init getattr(self, args.command)(unknown) File
"/home/str4d/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py",
line 169, in wrapper_func args = build_dist_from_args(ctx, dist, args)
File
"/home/str4d/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py",
line 2202, in build_dist_from_args build_order, python_modules, bs =
get_recipe_order_and_bootstrap(ctx, dist.recipes, bs) File
"/home/str4d/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py",
line 2262, in get_recipe_order_and_bootstrap
graph.remove_remaining_conflicts(ctx) File
"/home/str4d/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py",
line 481, in remove_remaining_conflicts recipe = Recipe.get_recipe(name,
ctx) File
"/home/str4d/.local/lib/python2.7/site-packages/pythonforandroid/toolchain.py",
line 1774, in get_recipe mod =
importlib.import_module("pythonforandroid.recipes.{}".format(name)) File
"/usr/lib/python2.7/importlib/init.py", line 37, in import_module import(name) ImportError: No module named zope.interface |
—
Reply to this email directly or view it on GitHub #449 (comment).
Activity
inclement commentedon Sep 12, 2015
I should be possible to depend on anything in pypi (which will then be automatically downloaded and installed if it's a pure python module), if that doesn't work then it's a bug. Does adding the pypi module name in the depends not work?
str4d commentedon Sep 12, 2015
The Python module is correctly detected in
get_recipe_order_and_bootstrap()at line 2245, but then in the subsequent call tograph.remove_remaining_conflicts()it blows up:inclement commentedon Sep 12, 2015
Okay, I guess recipes haven't ever depended on pypi modules before, so
it's a bug.
On 12/09/15 12:24, str4d wrote:
inclement commentedon Jan 10, 2016
A method to resolve this was introduced by #559