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/sources | |
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/sources')
3 files changed, 5 insertions, 0 deletions
diff --git a/tests/sources/no-fetch-cached/plugins/sources/always_cached.py b/tests/sources/no-fetch-cached/plugins/sources/always_cached.py index aef13279b..b5dfd772c 100644 --- a/tests/sources/no-fetch-cached/plugins/sources/always_cached.py +++ b/tests/sources/no-fetch-cached/plugins/sources/always_cached.py @@ -11,6 +11,8 @@ from buildstream import Source class AlwaysCachedSource(Source): + BST_MIN_VERSION = "2.0" + def configure(self, node): pass diff --git a/tests/sources/previous_source_access/plugins/sources/foo_transform.py b/tests/sources/previous_source_access/plugins/sources/foo_transform.py index dbc44c8aa..15fef43f8 100644 --- a/tests/sources/previous_source_access/plugins/sources/foo_transform.py +++ b/tests/sources/previous_source_access/plugins/sources/foo_transform.py @@ -14,6 +14,7 @@ from buildstream import Source, SourceError, utils class FooTransformSource(Source): + BST_MIN_VERSION = "2.0" # We need access to previous both at track time and fetch time BST_REQUIRES_PREVIOUS_SOURCES_TRACK = True diff --git a/tests/sources/project_key_test/plugins/sources/key-test.py b/tests/sources/project_key_test/plugins/sources/key-test.py index 88a211738..046034804 100644 --- a/tests/sources/project_key_test/plugins/sources/key-test.py +++ b/tests/sources/project_key_test/plugins/sources/key-test.py @@ -7,6 +7,8 @@ class KeyTest(Source): """ This plugin should fail if get_unique_key is called before track """ + BST_MIN_VERSION = "2.0" + def preflight(self): pass |