summaryrefslogtreecommitdiff
path: root/buildstream/plugin.py
Commit message (Collapse)AuthorAgeFilesLines
* plugin.py: Added new `allow_none` parameter to Plugin.node_get_member(), ↵Tristan Van Berkom2018-12-071-2/+3
| | | | | | | | | defaulting to False. Allow plugins to conveniently leverage the new `allow_none` parameter, and have Plugin.node_get_member() raise a LoadError in the usual case where None is not an acceptable value to be explicitly set in the user provided YAML.
* types.py: Moving CoreWarnings to the types.py moduleTristan Van Berkom2018-12-061-41/+19
| | | | | | This also ensures it is exposed via the main buildstream __init__.py file, fixes the imports of CoreWarnings, and adjusts the documentation links to point to the right place.
* plugin.py: Add BAD_ELEMENT_SUFFIX warningPhillip Smyth2018-11-301-0/+6
|
* plugin.py: Redirect DEBUG from `__del__` to `sys.stderr`danielsilverstone-ct/plugin-destroy-debug-to-stderrDaniel Silverstone2018-11-091-1/+2
| | | | | | | | | Previously, debug messages from `Plugin.__del__()` went to stdout which was a problem for the test suite in extremely rare and hard to predict circumstances. This corrects that by sending the message to stderr where all the rest of the messages tend to go. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
* various: Move _sentinel from utils.py to _yaml.pyDaniel Silverstone2018-10-261-1/+1
| | | | | | | | | The `_sentinel` in `utils.py` was used only for yaml node tracking. As such, simplify matters by removing it from `utils.py` and move it to `_yaml.py` which means that we no longer need to try and avoid a circular import issue by means of runtime importing. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
* plugin.py: use dict.get() instead of an if statementDaniel Silverstone2018-10-251-3/+1
| | | | | | | Pylint recommends the use of dict.get() rather than a multi-line if statement for handling optional keyword arguments. Signed-off-by: Daniel Silverstone <daniel.silverstone@codethink.co.uk>
* Spelling fixes: 'affect', not 'effect' as verbAngelos Evripiotis2018-10-191-1/+1
| | | | | Fix most instances of 'effect' being used as a verb instead of a noun. Skipped generated instance in doc/source/conf.py.
* Fix spelling of it's and itsRichard Dale2018-10-161-5/+5
|
* plugin.py: Added _configure() and _get_configuring() private APIsTristan Van Berkom2018-09-021-0/+27
| | | | | | | | | Keeps track of whether the plugin is currently being configured. Adjusted Element and Source classes to call _configure() in place of calling configure() directly. This is a part of #620
* plugin.py: Stop printing None for fatal-warningsJosh Smith2018-08-211-0/+1
| | | | | Providing warn with detail=None (default) will no longer print None when a fatal warning is triggered.
* docs: Add documentation for Configurable WarningsJosh Smith2018-08-151-1/+18
| | | | This includes detailing the use of `fatal-warnings` within project.conf
* _project.py: Add fatal-warnings configuration itemJosh Smith2018-08-151-4/+60
| | | | | | | | | | | | | | | | | | | | This allows for users to configure fatal-warnings to be either a list of warnings. This commit deprecates the use of fail-on-overlap within project.conf, this will now use the fatal-warnings configuration item. element.py: Cache key calculation now takes into account all of the fatal-warnings tests: This modifys the tests/frontend/overlaps.py tests to support the new fatal-warnings configuration. Backwards compatibility is also tested for `fail-on-overlap` _versions.py: BST_FORMAT_VERSION bumped to 15 for fatal-warnings BST_CORE_ARTIFACT_VERSION bumpted to 5 for fatal-warnings Fixes: #526
* plugin: bake API to get and validate a project pathTiago Gomes2018-08-021-1/+46
| | | | | | | | A project path is a path relative to a project directory. A project path can not also refer to the parent directory in the first path component, or point to symbolic links, fifos, sockets and block/character devices.
* element.py, source.py, plugin.py: Adjusting API version since annotations.Tristan Van Berkom2018-07-271-2/+2
| | | | | | Since we backported the temporary/permanent failures patch for #397 into the `bst-1.2` branch, we need to adjust the since versions in master down to 1.2.
* git.py: Update git plugin to fail temporarily on clone failuresJosh Smith2018-07-271-1/+1
| | | | | The git plugin will now make use of the fail_temporarily parameter to Plugin.call(), allowing failures to trigger a retry.
* plugin.py: Extend Plugin.call() APIJosh Smith2018-07-271-6/+11
| | | | | | | | Plugin.call() now takes fail_temporarily as an optional parameter, when supplied it will cause subsequent failures to trigger temporary errors as opposed to permanent errors. This also extends Plugin.check_output() which makes use of Plugin.call()
* Refactor: Use new logging mechanism from Contexttristan/local-cache-expiryTristan Van Berkom2018-07-181-13/+4
| | | | | | | | | | | | | o element.py / plugin.py: Removed supporting logging code, and derive the log handle from Context. o _scheduler/scheduler.py, _scheduler/queues/queue.py: Adapt to new Job initializer API for the logfile o _scheduler/jobs/job.py: Run job activities within the new context manager which turns on logging for a job. Also removed a lot of custom logging abstract methods which are unneeded. o _scheduler/jobs: Job implementations need not implement so much custom logging.
* Remove shebangs from python filesGökçen Nurlu2018-06-191-1/+0
| | | | Fixes #424
* doc/source/core_framework.rst: Use a toctree instead of linksTristan Van Berkom2018-06-091-2/+2
|
* buildstream/plugin.py: Fixing unused variablesTristan Van Berkom2018-04-191-7/+2
|
* buildstream/plugin.py, doc/source/projectconf.rst: Changed policy for core ↵Tristan Van Berkom2018-04-151-1/+5
| | | | | | | | | | | | | | plugin format revisioning The policy for format revisioning of core plugins maintained in BuildStream now changes such that we revision all plugins under the same core format version. This means that format extensions in plugins should be revisioned in the global _versions.BST_FORMAT_VERSION along with the core format, this simplifies parameterization of project.conf for usage of core plugins. This did not really require any code support as our plugins have never been revisioned before.
* plugin.py: Documentation improvements.Tristan Van Berkom2018-04-131-67/+110
| | | | | | | | Adding "Abstract Methods" section indicating what implementors have to implement. Also fixed some inconsistencies, and moved the abstract methods to the top of the class.
* Allow 'None' as a default_value for _yaml.node_getTristan Maat2018-04-071-1/+1
|
* _project.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-031-14/+2
| | | | | | | | | | | | | | | And adjust all surrounding sources for changed symbols. Additional details: o Added Project.get_shell_config() to report the shell configuration, instead of making those members all public o Moved assertions about project specified format versions required of plugins out of Plugin.__init__, and into Project.create_element() and Project.create_source(), so we can keep more things private This is a part of issue #285
* _context.py: Adhere to policy on private symbolsTristan Van Berkom2018-04-031-4/+4
| | | | | | And adjust all surrounding sources for changed symbols. This is a part of issue #285
* Remove unused importsJürg Billeter2018-03-251-1/+1
|
* pylint - dealt with global-statement warningJames Ennis2018-03-141-1/+1
|
* Allow plugins to forbid runtime dependencies and sourcesJonathan Maw2018-03-011-0/+11
| | | | | | The flags BST_FORBID_RDEPENDS and BST_FORBID_SOURCES can be set in the plugin's class declaration, and exceptions will be raised during pre-flight checks
* Add junction support for subprojectsJürg Billeter2018-02-081-0/+7
| | | | | This introduces junctions as a new kind of elements to allow dependencies to cross project boundaries.
* plugin.py: Removing Plugin.error() while it's still early and nobody is ↵Tristan Van Berkom2018-01-111-9/+0
| | | | | | | | | | using it. Errors are fatal, as such plugins must raise either SourceError() or ElementError(). This method was never used in plugins so far, lets remove it even though we are technically breaking (unused) API for the overall betterment of the API.
* plugin.py: Implement Plugin.timed_activity() using Context._timed_activity()Tristan Van Berkom2017-12-131-33/+5
|
* Remove unused importsGökçen Nurlu2017-12-071-3/+1
|
* Allow stdout and stderr to be overriden in Plugin.callValentin David2017-11-301-5/+4
|
* plugin.py: Add log() methodSam Thursfield2017-11-291-0/+12
| | | | This is a helper to log messages into the plugin's log file.
* plugin.py: Make timed_activity enforce keyword argsJonathan Maw2017-11-141-1/+1
|
* plugin.py: Make the logging methods use keyword argsJonathan Maw2017-11-141-5/+5
|
* Change node_get_member to use default instead of default_valueJonathan Maw2017-11-141-5/+5
|
* Refactor: Move context.py -> _context.pyTristan Van Berkom2017-11-081-8/+7
| | | | | | | | | | Consequently: o Changed Plugin.get_context() to a private Plugin._get_context() accessor. o Updated anything which imports Context to do so from private _context module o Updated docs to exclude the now private Context
* refactoring: Made Project option privateTristan Van Berkom2017-11-061-8/+7
| | | | | | | | | | | | | | This required adding two new APIs to make up for it on the Source o get_project_directory() Added here because elements should not be accessing external resources, Sources needed for local files and GPG keys and such o translate_url() Used by sources to mish-mash the project aliases and create real urls.
* Refactoring: Renamed _BstError -> BstErrorTristan Van Berkom2017-11-061-2/+2
| | | | | | Base class for exceptions is now a part of the already private _exceptions module Also moved PipelineError from _pipeline -> _exceptions module
* Refactoring: Move exceptions module to be privateTristan Van Berkom2017-11-061-2/+1
| | | | Hide all of buildstream's internal exceptions from the API surface.
* _yaml.py: Fixing inconsistently named API _yaml.validate_node()Tristan Van Berkom2017-10-011-1/+1
| | | | | | | | | | All of the _yaml APIs which deal with a node (dictionary loaded from YAML) are named _yaml.node_foo(), _yaml.node_bar(), _yaml.node_baz() etc, except for this one glaring exception. Also added a missing internal API documenting comment for _yaml.node_validate() Also updated all callers to _yaml.validate_node() to now call _yaml.node_validate().
* plugin.py: Make Plugin.node_items() just yield from _yaml.node_items()Tristan Van Berkom2017-10-011-4/+1
|
* plugin.py: Add note on plugin extension supportTristan Van Berkom2017-09-191-0/+7
| | | | Note: original patch by Tristan Maat on MR !92, wording modified.
* plugin.py: Fix documentation to link to correct file70-third-party-plugin-sharingTristan Van Berkom2017-09-141-1/+1
|
* Add documentationTristan Maat2017-09-141-1/+47
|
* Add element plugin node validationsTristan Maat2017-09-141-0/+25
|
* plugin.py: Removed special case for test casesTristan Van Berkom2017-09-031-3/+1
| | | | | | | Turns out this doesnt work once you try to actually run the full buildstream in a test case (in foreground it screws with other parsing, in background it fails in the test context with a strange error).
* documentation: Set page titles manually in python modules.Tristan Van Berkom2017-08-311-0/+4
|
* plugin.py: Added BST_FORMAT_VERSION class attribute to pluginsTristan Van Berkom2017-08-311-3/+33
| | | | | | | | | | Plugins can now advertize their respective format version with this class attribute. At instantiation time, the plugin will take care of asserting that the project's versioning requirements are met. Part of a fix for issue #69