oq-engine
oq-engine copied to clipboard
Only for development installations: see if there is a way to check the dependencies
Perhaps the engine could check the platform I am in, check the python version I am using, retrieve the right requirements.txt file, check that I have the right dependencies and if not print a warning with the instructions for fixing the installation (i.e. pip install -r requirements.txt).
The motivation is that we always forget to update the dependencies on some machines; moreover we have an unknown number of users out there with a development installation that do not know that it is time to update the dependencies (for instance pandas) or have too new dependencies.
NB: it must be a warning and not an error since it is okay to have different versions for testing purposes or other reasons. NB: this applies ONLY to devel installations. It is part of the job to find out what is the clean way to discover if we are in a development environment; a dirty way is
import openquake
devel = 'site-packages' not in openquake.__path__[0]
For server installations we can also consider notifying the sysadmin if a newer Django version is available
A better way to recognize development installations is to use 'git' in openquake.baselib.general.engine_version()