From 0eeed7c0a8198294b8100b807feba9337c49182a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Kl=C3=B6tzke?= Date: Mon, 19 Feb 2024 21:45:55 +0100 Subject: [PATCH] input: warn about pre 0.16 versions For the upcoming 1.0 release, every old behaviour before 0.16 will be removed. In the same vein, plugins targeting API versions before 0.15 are flagged too. --- pym/bob/input.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/pym/bob/input.py b/pym/bob/input.py index 3f3923d9..c7f9a026 100644 --- a/pym/bob/input.py +++ b/pym/bob/input.py @@ -39,6 +39,8 @@ help="Only the first such incident is reported. This behavior will be treated as an error in the future.") warnDeprecatedPluginState = Warn("Plugin uses deprecated 'bob.input.PluginState' API!") warnDeprecatedStringFn = Warn("Plugin uses deprecated 'stringFunctions' API!") +warnPrjMinimumVersion = Warn("Your project is too old. Support for versions before 0.16 will be removed soon.") +warnPluginMinimumVersion = Warn("Plugin API too old. Support for versions before 0.15 will be removed soon.") def isPrefixPath(p1, p2): """Check if the initial elements of ``p2`` equal ``p1``. @@ -3351,6 +3353,8 @@ def __loadPlugin(self, mangledName, fileName, name): if compareVersion(BOB_VERSION, apiVersion) < 0: raise ParseError("Your Bob is too old. Plugin '"+fileName+"' requires at least version "+apiVersion+"!") toolsAbiBreak = compareVersion(apiVersion, "0.15") < 0 + if toolsAbiBreak: + warnPluginMinimumVersion.warn(fileName) hooks = manifest.get('hooks', {}) if not isinstance(hooks, dict): @@ -3640,6 +3644,8 @@ def preValidate(data): if compareVersion(maxVer, minVer) < 0: raise ParseError("Layer '{}' reqires a higher Bob version than root project!" .format("/".join(layer))) + if compareVersion(minVer, "0.16") < 0: + warnPrjMinimumVersion.warn("/".join(layer)) maxVer = minVer # sub-layers must not have a higher bobMinimumVersion # Determine policies. The root layer determines the default settings