Skip to content

Commit

Permalink
input: warn about pre 0.16 versions
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jkloetzke committed Feb 22, 2024
1 parent 82cb055 commit 0eeed7c
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions pym/bob/input.py
Original file line number Diff line number Diff line change
Expand Up @@ -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``.
Expand Down Expand Up @@ -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):
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 0eeed7c

Please sign in to comment.