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

REST API: instructions unclear when dependencies are missing #1393

Closed
borellim opened this issue Apr 9, 2018 · 3 comments · Fixed by #5398
Closed

REST API: instructions unclear when dependencies are missing #1393

borellim opened this issue Apr 9, 2018 · 3 comments · Fixed by #5398
Assignees
Milestone

Comments

@borellim
Copy link
Member

borellim commented Apr 9, 2018

If a user didn't install aiida with the [REST] extra, and doesn't already have all the required packages, they will receive an import error when attempting to start the "verdi restapi" server. They might then attempt to install the required packages, one by one, until all the dependencies are satisfied. It would be better to tell the user to install aiida with the [REST] extra via pip.

@ltalirz
Copy link
Member

ltalirz commented Apr 9, 2018

Apropos: Since people can now use Materials Cloud to browse their AiiDA database, Giovanni suggested we might want to install the [rest] extra by default, when installing the aiida meta package.

That seems sensible to me as well.

@ltalirz
Copy link
Member

ltalirz commented May 11, 2018

@giovannipizzi

  1. Regarding improving the error message: Should we try to catch the missing imports?
    We can do that in a few files (api.py, run_api.py) of course, and for a few imports (flask, flask_cors, ...) and cover most use cases, but I wonder whether there is a better way...
    If someone adds a new dependency above our try/except, it will be broken again.
  2. Should we make the rest extra a default or not?

@giovannipizzi
Copy link
Member

I think we should just catch the first error that appears in the code run by verdi restapi, with a try/except ImportError. But I'm also thinking that maybe it's better to just add all REST dependencies a default (even in aiida_core?)

@waychal waychal added this to the v1.0.0 milestone Dec 3, 2018
@giovannipizzi giovannipizzi self-assigned this Dec 17, 2018
@sphuber sphuber modified the milestones: v1.0.0, v1.1.0 Apr 3, 2019
@sphuber sphuber removed this from the v1.1.0 milestone Feb 28, 2020
@sphuber sphuber added this to the v2.0.0 milestone Feb 27, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants