gem / oq-engine

OpenQuake Engine: a software for Seismic Hazard and Risk Analysis
https://github.com/gem/oq-engine/#openquake-engine
GNU Affero General Public License v3.0
377 stars 273 forks source link

Only for development installations: see if there is a way to check the dependencies #9018

Closed micheles closed 4 months ago

micheles commented 11 months ago

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]
ptormene commented 10 months ago

For server installations we can also consider notifying the sysadmin if a newer Django version is available

micheles commented 4 months ago

A better way to recognize development installations is to use 'git' in openquake.baselib.general.engine_version()