diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-04-28 19:23:31 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-04-29 16:24:59 +0900 |
commit | a311a14f4b0a649b5f872ab020885b0a1d6e09d1 (patch) | |
tree | c94ddb9ff24108b72d4e0c2e8902bf24d6702b95 /tests/frontend | |
parent | b3556a3284708b904f20586d4636c31a91106809 (diff) | |
download | buildstream-a311a14f4b0a649b5f872ab020885b0a1d6e09d1.tar.gz |
plugin.py/pluginfactory.py: Implementing BST_MIN_VERSION
The BST_MIN_VERSION guards assert that the BuildStream core which
loaded the plugin is compatible with the plugin itself.
This commit adds BST_MIN_VERSION to the base plugin.py with documentation
informing Plugin authors how to set the minimum version, and also adds
the assertions at plugin loading time in pluginfactory.py.
This commit also:
* Adds the BST_MIN_VERSION specification to all current core plugins
* Adds the BST_MIN_VERSION specification to plugins used in test cases
Diffstat (limited to 'tests/frontend')
7 files changed, 21 insertions, 0 deletions
diff --git a/tests/frontend/configuredwarning/plugins/corewarn.py b/tests/frontend/configuredwarning/plugins/corewarn.py index bef0a4904..bcd40753c 100644 --- a/tests/frontend/configuredwarning/plugins/corewarn.py +++ b/tests/frontend/configuredwarning/plugins/corewarn.py @@ -3,6 +3,9 @@ from buildstream.plugin import CoreWarnings class CoreWarn(Element): + + BST_MIN_VERSION = "2.0" + def configure(self, node): pass diff --git a/tests/frontend/configuredwarning/plugins/warninga.py b/tests/frontend/configuredwarning/plugins/warninga.py index 9fd8dc61b..4ad0f3d20 100644 --- a/tests/frontend/configuredwarning/plugins/warninga.py +++ b/tests/frontend/configuredwarning/plugins/warninga.py @@ -4,6 +4,9 @@ WARNING_A = "warning-a" class WarningA(Element): + + BST_MIN_VERSION = "2.0" + def configure(self, node): pass diff --git a/tests/frontend/configuredwarning/plugins/warningb.py b/tests/frontend/configuredwarning/plugins/warningb.py index 64d25ef39..c7a995cf8 100644 --- a/tests/frontend/configuredwarning/plugins/warningb.py +++ b/tests/frontend/configuredwarning/plugins/warningb.py @@ -4,6 +4,9 @@ WARNING_B = "warning-b" class WarningB(Element): + + BST_MIN_VERSION = "2.0" + def configure(self, node): pass diff --git a/tests/frontend/consistencyerror/plugins/consistencybug.py b/tests/frontend/consistencyerror/plugins/consistencybug.py index abcbbc997..1952894ca 100644 --- a/tests/frontend/consistencyerror/plugins/consistencybug.py +++ b/tests/frontend/consistencyerror/plugins/consistencybug.py @@ -2,6 +2,9 @@ from buildstream import Source class ConsistencyBugSource(Source): + + BST_MIN_VERSION = "2.0" + def configure(self, node): pass diff --git a/tests/frontend/consistencyerror/plugins/consistencyerror.py b/tests/frontend/consistencyerror/plugins/consistencyerror.py index 2e30d4842..34af45782 100644 --- a/tests/frontend/consistencyerror/plugins/consistencyerror.py +++ b/tests/frontend/consistencyerror/plugins/consistencyerror.py @@ -2,6 +2,9 @@ from buildstream import Source, SourceError class ConsistencyErrorSource(Source): + + BST_MIN_VERSION = "2.0" + def configure(self, node): pass diff --git a/tests/frontend/project/plugins/randomelement.py b/tests/frontend/project/plugins/randomelement.py index e9be98fc7..12afaaa6d 100644 --- a/tests/frontend/project/plugins/randomelement.py +++ b/tests/frontend/project/plugins/randomelement.py @@ -4,6 +4,9 @@ from buildstream import Element class RandomElement(Element): + + BST_MIN_VERSION = "2.0" + def configure(self, node): pass diff --git a/tests/frontend/project/sources/fetch_source.py b/tests/frontend/project/sources/fetch_source.py index c62d1d29a..6078e5e5f 100644 --- a/tests/frontend/project/sources/fetch_source.py +++ b/tests/frontend/project/sources/fetch_source.py @@ -32,6 +32,9 @@ class FetchFetcher(SourceFetcher): class FetchSource(Source): + + BST_MIN_VERSION = "2.0" + # Read config to know which URLs to fetch def configure(self, node): self.original_urls = node.get_str_list("urls") |