| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
Stack elements merely represent a logical group of elements. For this
reason, sources do not make sense.
|
|
|
|
|
| |
`import` elements imports files directly from its sources. As such, build
dependencies do no make sense.
|
|\
| |
| |
| |
| | |
Rewrite of the Node API
See merge request BuildStream/buildstream!1472
|
| | |
|
| |
| |
| |
| |
| | |
We need to update every place where we were passing a yaml 'dict' to
now pass a 'MappingNode'
|
| |
| |
| |
| |
| | |
_create_new_file did not use the 'toplevel' parameter, we can therefore
remove it.
|
| | |
|
| |
| |
| |
| |
| | |
Users should not have to know anything about nodes, and should be
greeted by commonly defined yaml types.
|
| |
| |
| |
| |
| |
| |
| |
| | |
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 reduces slightly the amount of C code needed and makes the run
marginally faster
|
| |
| |
| |
| |
| | |
This way, it is easier to know what is BuildStream-private from
what is module-private
|
| | |
|
| |
| |
| |
| | |
This is not needed for plugins and should therefore not be public
|
| |
| |
| |
| |
| | |
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 method is only ever used in this context and should not be on the
base Node anyways
|
| |
| |
| |
| |
| | |
Users should not need to get access to any of those, and should only
need access to the ProvenanceInformation to print it.
|
| | |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
Now that we get scalar Nodes, it is easier to just give the node and
extract the provenance as needed.
|
| |
| |
| |
| |
| |
| |
| | |
Now that we have scalar nodes, we can directly give the scalar to the
method.
- Adapt the plugin method to also not access via the key
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
With nodes being propagated better, we now don't need to extract
provenance beforehand. Therefore removing the ability to provide
indiced when getting provenance.
- Also add 'scalar_at' on 'SequenceNode', in order to fetch a scalar
node at a specific indice
|
| |
| |
| |
| |
| | |
The provenance can be constructed afterwards, so we don't need to
pre-calculate it.
|
| |
| |
| |
| |
| |
| |
| | |
Cython can bypass the normal python mechanism to create new objects,
which makes their instantation faster. See
https://cython.readthedocs.io/en/latest/src/userguide/extension_types.html#fast-instantiation
for more details.
|
| |
| |
| |
| |
| |
| |
| |
| | |
This allows us to type its value more strictly, allowing for more
efficient access.
- Also implement 'node_at' on 'SequenceNode', to allow some tests to
test some internals generically.
|
| |
| |
| |
| |
| | |
This ensures that we are not breaking our encapsulation and that the
modules accessing 'Node' from C are correctly typed.
|
| |
| |
| |
| |
| | |
A direct replacement would be isinstance(obj, MappingNode) if someone
really needs it.
|
| |
| |
| |
| | |
- adapt all call sites to use the new API
|
| |
| |
| |
| |
| |
| |
| | |
Using 'Node.from_dict({})' can replace new_empty_node, and the rest
is not needed anymore.
- Adapt all call sites
|
| |
| |
| |
| |
| |
| |
| | |
There was a single place using 'node_extend_list', which we can replace
more easily with 'SequenceNode.append'.
Also rewrite _projectrefs.py:_lookup to use the new API more effectively
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This changes how we were handling synthetic nodes. Previously, we would
have them as coming from a 'SYNTHETIC_FILE'. This is not correct when
we need the position in the real file when adding new information to a
file we will end up writing to disk (like project_ref).
This is a prerequisite for further work on cleaning how it is done.
|
| |
| |
| |
| |
| |
| |
| | |
This new methods is here to replace the previous 'new_node_from_dict'
that will be moved to a private method.
Adapt all call sites to use the new 'from_dict' method.
|
| |
| |
| |
| |
| | |
- Also take care of node_composite_move in the same way.
- Adapt all calling places
|
| | |
|
| |
| |
| |
| |
| |
| | |
We had a large if-else clause in 'composite_dict' that was looking at
the type of the source and acting based on that. This is easier to
handle once split on each type of 'Node'
|
| | |
|
| | |
|
| |
| |
| |
| |
| | |
'composite_dict' is a more internal method and we don't really need to
access it there
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Some call places do not need calls to 'node_sanitize' anymore, therefore
removing the call entirely.
Other still use it for convenience, but that doesn't seem the right way
to do it for consistency. Those places have been replaced by calls to
'Node.strip_node_info()'.
|
| |
| |
| |
| |
| | |
Remove completely '_yaml.dump()' and replace all notions and call by
'roundtrip_dump'
|
| |
| |
| |
| |
| | |
Now that both are equivalent, we can skip the sanitization part before
the yaml call.
|
| |
| |
| |
| |
| | |
This removes the need of calling _yaml.dump(), as roundtrip_dump
is now equivalent.
|
| |
| |
| |
| |
| |
| | |
This removes the need of manually stringifying the values in
roundtrip_dump by registering special Ruamel representer for each
value we might expect.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Since ujson already sorts the keys, we just need to be able to jsonify
Nodes sensibly. This is done by implementing __json__ on the 'Node' base
class.
This does not break the cache keys.
|
| | |
|