diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-04-24 18:12:54 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-04-29 16:24:58 +0900 |
commit | d63bd7e9def528d3ed59a2798452ac1da58ebea4 (patch) | |
tree | 05153205e2d5fa8644af7d877319a3cbc0566b68 /tests/internals/pluginloading | |
parent | 82eb1d4271bb634f248bc9e1770119d2815d7cd6 (diff) | |
download | buildstream-d63bd7e9def528d3ed59a2798452ac1da58ebea4.tar.gz |
Plugin loading refactor, removing all versioning
Plugin format versioning was decided to be removed for local
plugins and any plugins for which we do not load an explicitly
provided plugin. For pip, this will be handled with a standard
distutils/setuptools approach, allowing users to specify pip
style version boundaries in the plugin origins.
This patch refactors plugin loading so that all related code
goes into the private _pluginfactory module, a new small
PluginOrigin type was added to better manipulate loaded
origins.
Test cases have been removed and will be readded in a following
commit, adjusted to new expectations.
Diffstat (limited to 'tests/internals/pluginloading')
10 files changed, 2 insertions, 67 deletions
diff --git a/tests/internals/pluginloading/badversionelement/customelements/__init__.py b/tests/internals/pluginloading/badversionelement/customelements/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/tests/internals/pluginloading/badversionelement/customelements/__init__.py +++ /dev/null diff --git a/tests/internals/pluginloading/badversionelement/customelements/foo.py b/tests/internals/pluginloading/badversionelement/customelements/foo.py deleted file mode 100644 index 75536e87f..000000000 --- a/tests/internals/pluginloading/badversionelement/customelements/foo.py +++ /dev/null @@ -1,19 +0,0 @@ -from buildstream import Element - - -class FooElement(Element): - - BST_FORMAT_VERSION = 5 - - def preflight(self): - pass - - def configure(self, node): - pass - - def get_unique_key(self): - return {} - - -def setup(): - return FooElement diff --git a/tests/internals/pluginloading/badversionelement/elements/simple.bst b/tests/internals/pluginloading/badversionelement/elements/simple.bst deleted file mode 100644 index f949dc5b5..000000000 --- a/tests/internals/pluginloading/badversionelement/elements/simple.bst +++ /dev/null @@ -1,4 +0,0 @@ -kind: foo -description: Custom foo element -config: - some: thing diff --git a/tests/internals/pluginloading/badversionelement/project.conf b/tests/internals/pluginloading/badversionelement/project.conf deleted file mode 100644 index bff73e251..000000000 --- a/tests/internals/pluginloading/badversionelement/project.conf +++ /dev/null @@ -1,10 +0,0 @@ -name: pony -min-version: 2.0 -element-path: elements - -plugins: -- origin: local - path: customelements - elements: - # We provided bar at version 5, should be a conflict. - foo: 10 diff --git a/tests/internals/pluginloading/badversionsource/customsources/__init__.py b/tests/internals/pluginloading/badversionsource/customsources/__init__.py deleted file mode 100644 index e69de29bb..000000000 --- a/tests/internals/pluginloading/badversionsource/customsources/__init__.py +++ /dev/null diff --git a/tests/internals/pluginloading/badversionsource/customsources/foo.py b/tests/internals/pluginloading/badversionsource/customsources/foo.py deleted file mode 100644 index 628f99b29..000000000 --- a/tests/internals/pluginloading/badversionsource/customsources/foo.py +++ /dev/null @@ -1,16 +0,0 @@ -from buildstream import Source - - -class BarSource(Source): - - BST_FORMAT_VERSION = 5 - - def preflight(self): - pass - - def configure(self, node): - pass - - -def setup(): - return BarSource diff --git a/tests/internals/pluginloading/badversionsource/elements/simple.bst b/tests/internals/pluginloading/badversionsource/elements/simple.bst deleted file mode 100644 index 7e0cc43b7..000000000 --- a/tests/internals/pluginloading/badversionsource/elements/simple.bst +++ /dev/null @@ -1,6 +0,0 @@ -kind: autotools -description: Custom foo source -sources: -- kind: foo - ref: 1.2.3 - uri: http://ponyland.com diff --git a/tests/internals/pluginloading/badversionsource/project.conf b/tests/internals/pluginloading/badversionsource/project.conf deleted file mode 100644 index cd5b2dc82..000000000 --- a/tests/internals/pluginloading/badversionsource/project.conf +++ /dev/null @@ -1,10 +0,0 @@ -name: pony -min-version: 2.0 -element-path: elements - -plugins: -- origin: local - path: customsources - sources: - # We provided bar at version 5, should be a conflict. - foo: 10 diff --git a/tests/internals/pluginloading/customelement/project.conf b/tests/internals/pluginloading/customelement/project.conf index 6a33cc504..2619bdf82 100644 --- a/tests/internals/pluginloading/customelement/project.conf +++ b/tests/internals/pluginloading/customelement/project.conf @@ -5,4 +5,4 @@ plugins: - origin: local path: pluginelements elements: - foo: 0 + - foo diff --git a/tests/internals/pluginloading/customsource/project.conf b/tests/internals/pluginloading/customsource/project.conf index 87d9b5d09..5cb6da537 100644 --- a/tests/internals/pluginloading/customsource/project.conf +++ b/tests/internals/pluginloading/customsource/project.conf @@ -5,4 +5,4 @@ plugins: - origin: local path: pluginsources sources: - foo: 0 + - foo |