summaryrefslogtreecommitdiff
path: root/src/buildstream/_project.py
Commit message (Collapse)AuthorAgeFilesLines
* _yaml: Remove 'node_del' and support `del mapping[key]`Benjamin Schubert2019-06-271-3/+3
| | | | | - Also add a convenience method 'safe_del' catching the exception when we don't care if the value was there or not.
* _yaml: Remove 'node_copy' and add 'Node.copy()'bschubert/node-copyBenjamin Schubert2019-06-271-6/+6
| | | | Also adaprt every part of the code calling it
* _yaml: Introduce 'get_sequence()' and 'sequence_at()'/'mapping_at()'Benjamin Schubert2019-06-251-14/+12
| | | | | | | | | - 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_int()' on ScalarNodeBenjamin Schubert2019-06-251-3/+3
| | | | | | - Add the 'as_int()' method on 'ScalarNode' to replace 'node_get(mapping, key, int)' - Adapt all call sites to use the new API
* _yaml: Add 'as_bool()' and 'is_none()' to ScalarNodeBenjamin Schubert2019-06-251-5/+5
| | | | | | | | | | | - '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
* _yaml: Add 'as_str()' on ScalarNode and 'get_scalar()' on MappingNodeBenjamin Schubert2019-06-251-17/+17
| | | | | | | | | | - '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.
* _yaml: add 'get_mapping()' to MappingNodeBenjamin Schubert2019-06-251-16/+16
| | | | | | | | 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.
* Handle subproject fetching in the Stream classJürg Billeter2019-06-251-4/+4
|
* Always fetch subprojects as neededJürg Billeter2019-06-251-7/+2
| | | | | | 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.
* _yaml.pyx: Forbid expected_type=Mapping, and remove isinstance checkBenjamin Schubert2019-06-031-18/+17
| | | | | | | | | | | Calls to `isinstance` can be particularily costly. Using type() is much faster. The only known case where the `isinstance` was useful is for dictionnaries where we would ask for a 'Mapping' instead. Disallowing 'Mapping' for expected_type considerably speeds up the calls to this functions. Also add into NEWS
* Move source from 'buildstream' to 'src/buildstream'Chandan Singh2019-05-211-0/+975
This was discussed in #1008. Fixes #1009.