Refined version management

Tests running here: https://ci.openquake.org/job/zdevel_oq-engine/939