diff --git a/newsfragments/+blocking-min_version.feature b/newsfragments/+blocking-min_version.feature new file mode 100644 index 0000000000000000000000000000000000000000..92f1f41e33665e89c34fe9523dffa023f4de2881_bmV3c2ZyYWdtZW50cy8rYmxvY2tpbmctbWluX3ZlcnNpb24uZmVhdHVyZQ== --- /dev/null +++ b/newsfragments/+blocking-min_version.feature @@ -0,0 +1,1 @@ +Not respecting min_version now stops scripts \ No newline at end of file diff --git a/odoo_scripts/_config.py b/odoo_scripts/_config.py index ca1658f6b33b241f3405fcb2dfcbc9aa2aeb2ef8_b2Rvb19zY3JpcHRzL19jb25maWcucHk=..92f1f41e33665e89c34fe9523dffa023f4de2881_b2Rvb19zY3JpcHRzL19jb25maWcucHk= 100644 --- a/odoo_scripts/_config.py +++ b/odoo_scripts/_config.py @@ -46,6 +46,10 @@ _logger = logging.getLogger(__name__) +class InvalidVersion(Exception): + """The odoo_scripts version is not what is expected""" + + class Configuration: """ At the moment, only read from `setup.cfg`. @@ -211,7 +215,10 @@ self.min_version: Version read_expanded("min_version", parse("0"), parse) if hasattr(self, "min_version") and parse(version) < self.min_version: - _logger.error("Odoo scripts %s is less than %s", version, self.min_version) + _logger.fatal("Odoo scripts %s is less than %s", version, self.min_version) + raise InvalidVersion( + "Odoo scripts {} is less than {}".format(version, self.min_version) + ) self.python_packages: Dict[str, Dict[str, Union[str, List[Tuple[str, str]]]]] if toread("python_packages"):