diff options
author | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-04-30 16:21:19 +0900 |
---|---|---|
committer | Tristan Van Berkom <tristan.vanberkom@codethink.co.uk> | 2020-05-04 17:55:32 +0900 |
commit | d1d002dec836579e0f708ad438a8265070963c51 (patch) | |
tree | 8e29e2b82bb55987c34c9f3c26d4abbb67333c7a /src/buildstream/_project.py | |
parent | e13275bdd92aae182d7e93f5b916c4fc4fd280f8 (diff) | |
download | buildstream-d1d002dec836579e0f708ad438a8265070963c51.tar.gz |
plugin.py: Rework how deprecation warnings are configured.
This is mostly a semantic change which defines how deprecation warnings
are suppressed in a more consistent fashion, by declaring such suppressions
in the plugin origin declarations rather than on the generic element/source
configuration overrides section.
Other side effects of this commit are that the warnings have been enhanced
to include the provenance of whence the deprecated plugins have been used in
the project, and that the custom deprecation message is optional and will
appear in the message detail string rather than in the primary warning text,
which now simply indicates that the plugin being used is deprecated.
Documentation and test cases are updated.
This fixes #1291
Diffstat (limited to 'src/buildstream/_project.py')
-rw-r--r-- | src/buildstream/_project.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/buildstream/_project.py b/src/buildstream/_project.py index 40524d7ad..45f3b4d34 100644 --- a/src/buildstream/_project.py +++ b/src/buildstream/_project.py @@ -951,10 +951,10 @@ class Project: origins = config.get_sequence("plugins", default=[]) for origin_node in origins: origin = PluginOrigin.new_from_node(self, origin_node) - for kind in origin.elements: - output.element_factory.register_plugin_origin(kind, origin) - for kind in origin.sources: - output.source_factory.register_plugin_origin(kind, origin) + for kind, conf in origin.elements.items(): + output.element_factory.register_plugin_origin(kind, origin, conf.allow_deprecated) + for kind, conf in origin.sources.items(): + output.source_factory.register_plugin_origin(kind, origin, conf.allow_deprecated) # _warning_is_fatal(): # |