| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
| |
A direct replacement would be isinstance(obj, MappingNode) if someone
really needs it.
|
|\
| |
| |
| |
| | |
Rework node compose API
See merge request BuildStream/buildstream!1442
|
| |
| |
| |
| |
| | |
- 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
|
|\
| |
| |
| |
| | |
_yaml: Move 'node_final_assertions' to 'Node._assert_fully_composited'
See merge request BuildStream/buildstream!1444
|
|/ |
|
|\
| |
| |
| |
| | |
Remove the need for 'node_sanitize'
See merge request BuildStream/buildstream!1438
|
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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.
|
| |
|
|
|
|
|
|
|
| |
- node_find_target with 'key' is only used once in the codebase.
We can remove and simplify this function
- Allow 'MappingNode.get_node()' to be called without any
'expected_types'
|
|
|
|
|
|
| |
- Implement __setitem__ on 'MappingNode'
- Implement __setitem__ on 'SequenceNode'
- Adapt all call sites to use the new calling way.
|
|
|
|
|
|
| |
One difference is that 'MappingNode.items()' does not strip the
provenance from scalars and lists, which ends up not affecting the
code much.
|
|
|
|
|
|
|
| |
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
|
|
|
|
|
| |
This mimics the dict.keys() method but returns a list instead of a
dict_keys, for cython performance reasons
|
|
|
|
|
| |
- 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
|
|
|
|
| |
We shouldn't have to create normal nodes ever. Let's ensure we don't
|
| |
|
| |
|
|
|
|
| |
This can now be done more easily with the Node api
|
|
|
|
|
|
|
| |
The new yaml API is able of getting these access with the same error
messages handling.
Having this helper is therefore not useful anymore.
|
|
|
|
|
| |
This method is unused and can be easily reimplemented with the new
Node API by looping over nodes.
|
|
|
|
|
|
| |
This function is hard to make generic and, with the new API, the access
is simplified. Therefore, removing this function and migrating all its
usages
|
|
|
|
|
|
|
|
|
| |
- 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.
|
|
|
|
|
|
| |
- Add the 'as_int()' method on 'ScalarNode' to replace
'node_get(mapping, key, int)'
- Adapt all call sites to use the new API
|
|
|
|
|
|
|
|
|
|
|
| |
- 'as_bool()' casts a ScalarNode into a boolean, understanding both
'True' and 'False' as truthy-falsy values, as per node_get(type=bool)
behavior
- 'is_none()' allwos checking whether the scalar node contains a 'None'
value. Since 'None' cannot be used when working with booleans, we need
to have a way of checking for 'None' when we actually need the
information of whether the value is unset.
- Adapt all call places to use the new API
|
|
|
|
|
|
|
|
|
|
| |
- '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.
|
|
|
|
|
|
|
|
| |
This allows to get a mapping node from another 'MappingNode',
replacing 'node_get(my_mapping, key, type=dict)'
Also changes all places where 'node_get' was called like that by
the new API.
|
|
|
|
|
|
|
| |
This allows us to represent sequences (lists) more efficiently.
This is the third type that is needed in order to know what kind of
datastructure we are handling in our graph.
|
|
|
|
|
| |
This allows us to specialize the base 'Node' class to store mappings
(dicts) more efficiently.
|
|
|
|
|
|
|
|
| |
This node specializes the 'Node' class to represent a scalar value.
This allows us to let users access leaf Nodes in the graph without
having to find them with `node_find_target`, and also will allow
us lazier computation of node provenance in some cases.
|
|\
| |
| |
| |
| | |
cascache.py: pick some nits
See merge request BuildStream/buildstream!1433
|
| | |
|
|/ |
|
|\
| |
| |
| |
| | |
Fetch sources as needed for bst source checkout
See merge request BuildStream/buildstream!1427
|
| | |
|
|/
|
|
|
| |
This removes the --fetch option of bst source checkout, always enabling
fetch support. This is in line with fetching subprojects as needed.
|
|\
| |
| |
| |
| |
| |
| | |
Capabilities service
Closes #915
See merge request BuildStream/buildstream!1410
|
| |
| |
| |
| |
| |
| | |
Not needed now that capabilities service is used.
Part of #915
|