summaryrefslogtreecommitdiff
path: root/src/buildstream/_plugincontext.py
Commit message (Collapse)AuthorAgeFilesLines
* Reformat code using BlackChandan Singh2019-11-141-70/+70
| | | | | | | As discussed over the mailing list, reformat code using Black. This is a one-off change to reformat all our codebase. Moving forward, we shouldn't expect such blanket reformats. Rather, we expect each change to already comply with the Black formatting style.
* _plugincontext: stable ids for better picklingAngelos Evripiotis2019-10-311-8/+23
| | | | | | | | | | | | | Use the 'identifier' argument of PluginBase's make_plugin_source(), to ensure that the plugins have a consistent namespace when pickled and then unpickled in another process. This means that we can pickle plugins that are more than an entrypoint, e.g. ones that have multiple classes in the same file. This enables the `tests/frontend/mirror.py::test_mirror_fetch_multi` test to pass, which uses `fetch_source` plugin. That plugin has more than one class in it's file.
* Make ChildJobs and friends picklableAngelos Evripiotis2019-07-241-1/+48
| | | | | | | | | Pave the way toward supporting the 'spawn' method of creating jobs, by adding support for pickling ChildJobs. Introduce a new 'jobpickler' module that provides an entrypoint for this functionality. This also makes replays of jobs possible, which has made the debugging of plugins much easier for me.
* _exceptions.py: Align LoadError() parameter orderingtpollard/loaderrorTom Pollard2019-07-181-3/+3
| | | | | | All of the errors which subclass from BstError have their first positional argument as message, LoadError should follow this ordering for consistency.
* node: Add 'get_str_list' on 'MappingNode'Benjamin Schubert2019-07-171-1/+1
| | | | | | `mapping.get_sequence(...).as_str_list()` is a very common pattern seen both in plugins and the core. Adding a helper to reduce the number of operations will make usage smoother
* _yaml: Introduce 'get_sequence()' and 'sequence_at()'/'mapping_at()'Benjamin Schubert2019-07-151-2/+1
| | | | | | | | | - Adding 'get_sequence' on MappingNode to access sequences in a mapping - Adding 'sequence_at' on SequenceNode to access sequences in a sequence - Adding 'mapping_at' on SequenceNode to access mappings in a sequence Using "*_at" in sequences allows us to quickly understand if we are dealing with a sequence or a mapping.
* _yaml: Add 'as_str()' on ScalarNode and 'get_scalar()' on MappingNodeBenjamin Schubert2019-07-151-5/+5
| | | | | | | | | | - 'get_scalar()' allows retrieving a scalar node from a mapping. - 'as_str()' casts a ScalarNode into a string (thus removing the node information). Both together, those replace 'node_get(mapping, key, type=str)' but also allow retrieving the 'Node' itself, which will allow in the future lazier provenance computation.
* _plugincontext: rm unused self._dependenciesAngelos Evripiotis2019-07-091-3/+3
| | | | Also document the pre-existing format_versions parameter.
* _plugincontext: simplify if statementAngelos Evripiotis2019-07-091-3/+4
| | | | | Add shortened local vars to make this statement easier to read and fit onto one line.
* Move source from 'buildstream' to 'src/buildstream'Chandan Singh2019-05-211-0/+239
This was discussed in #1008. Fixes #1009.