Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[revamp] Recipes can only depend on other recipes #449

Closed
str4d opened this issue Sep 12, 2015 · 4 comments
Closed

[revamp] Recipes can only depend on other recipes #449

str4d opened this issue Sep 12, 2015 · 4 comments

Comments

@str4d
Copy link
Contributor

str4d commented Sep 12, 2015

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?

@inclement
Copy link
Member

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
Copy link
Contributor Author

str4d commented Sep 12, 2015

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

@inclement
Copy link
Member

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).

This was referenced Sep 13, 2015
@inclement inclement removed the revamp label Oct 5, 2015
@inclement
Copy link
Member

A method to resolve this was introduced by #559

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants