| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
|
|
|
|
|
| |
As a rule, throughout the codebase we should not be using internal
ProvenanceInformation objects in our APIs, but rather Node objects.
This is because ProvenanceInformation is generated on the fly from
a Node object, and it is needlessly expensive to instantiate one before
it is absolutely needed.
This patch unilaterally fixes the codebase to pass `provenance_node`
Node objects around as arguments rather than `provenance` ProvenanceInformation
objects.
|
|
|
|
|
|
| |
This forces the `provenance` to `Loader.get_loader()` to be
a mandatory argument, ensuring that there are never any
callers which fail to provide provenance.
|
|
|
|
|
|
|
|
|
|
|
| |
Instead of raising a customized error message which adds little
value to the provenance, just pass the provenance along.
This is important so that the Loader is aware of the provenance
of loaded junctions, so that it can more precisely report errors
about conflicting junctions when includes cause conflicts.
This commit also adjusts tests/format/includes.py
|
|
|
|
|
| |
Need to consider only the last element of a path as the filename
while the rest of the path is a junction path.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* This file had `clean_caches()` documented as public but
the function was actually private `_clean_caches()`: Moved this to
the end of the class in the private section.
* The `_get_loader()` was marked as private but is in fact public,
and used by the project to load cross junction include files.
This patch also updates `_includes.py` to call the public `get_loader()`
method instead of sneaking in and calling the private `_get_loader()` method
(while also removing one redundant line of code from the same function).
|
| |
|
|
|
|
|
|
|
|
|
| |
Unfortunately the options from main project cannot always be processed
in the include processing since project configuration might load
option declarations from a separate file. For that reason the result
of `Include.process` should still be passed through the option
processor. But all options files included from junctioned are already
evaluated.
|
|
|
|
|
|
|
| |
Plugin tests are already accessing this API, but using imports from
private modules. For motivation for this to be exposed publicly, note
that ErrorDomain is an argument for most things in runcli.py, and
LoadErrorReason may be another.
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
| |
In the latest released version of pylint (2.3.x), the
"no-else-raise" (R1720) warning has been introduced.
See:
http://pylint.pycqa.org/en/latest/whatsnew/changelog.html#what-s-new-in-pylint-2-3-0
There are many instances of this in our codebase, which this
patch addresses.
|
|
|
|
|
|
| |
All of the errors which subclass from BstError have their first
positional argument as message, LoadError should follow this
ordering for consistency.
|
|
|
|
|
|
|
|
| |
A 'clone' operation has an implicit understanding that it is expensive,
which is not the case of a 'copy' operation, which is more usually
a shallow copy.
Therefore renaming to 'clone'
|
|
|
|
|
| |
This makes the 'Node' API public, and available for use directly for
plugins.
|
|
|
|
|
|
|
| |
- _composite -> __composite (internal)
- composite -> _composite (BuildStream private)
- composite_under -> _composite_under (BuildStream private)
- get -> _get (internal)
|
|
|
|
|
|
|
|
| |
This replaces the helper method by adding a 'get_provenance' on the node
directly
- Adapt all call sites
- Delay getting provenance wherever possible without major refactor
|
|
|
|
|
| |
- Also take care of node_composite_move in the same way.
- Adapt all calling places
|
|
|
|
|
|
|
| |
This is to mimic the 'dict.values()' interface.
- Adapt parts of the code calling 'node_items' but ignoring the
first value to use this instead
|
|
|
|
|
| |
- Also add a convenience method 'safe_del' catching the exception
when we don't care if the value was there or not.
|
|
|
|
| |
Also adaprt every part of the code calling it
|
|
|
|
|
|
|
|
|
|
|
| |
Sometimes, we might want to have a list or a string, in which case, we
can now use 'get_node', which can return multiple types.
This method doesn't contain a 'default' value, as building a 'Node' from
it would be hard. We therefore just have a 'allow_none' flag that allows
returning 'None' when the value is not found.
- includes: use the new 'get_node' instead of trying multiple versions
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
|
| |
In a strongly typed API with Node, having a 'None' as expected type
is hard to make nice. Moreover, this is rarely used in the codebase.
Thus, adapting the call sites to not use 'None' as an expected type.
|
|
|
|
|
|
| |
Treat junction element sources the same as sources of any other element
and always fetch subprojects as needed. Do not ask the user to manually
fetch subprojects.
|
|
This was discussed in #1008.
Fixes #1009.
|