diff options
author | Benjamin Schubert <ben.c.schubert@gmail.com> | 2019-07-10 10:22:35 +0100 |
---|---|---|
committer | bst-marge-bot <marge-bot@buildstream.build> | 2019-07-15 14:14:03 +0000 |
commit | e6caca7071e9a007f0ec0b59662b7b28e05cd4b1 (patch) | |
tree | 8fd7f26b8e6c41cb3f940b05c0aae2f2f667832a | |
parent | a1705d5e5ee5ed714528fff37520bf774f8f2fbe (diff) | |
download | buildstream-e6caca7071e9a007f0ec0b59662b7b28e05cd4b1.tar.gz |
_yaml: Mark 'strip_node_info' as buildstream-private
-rw-r--r-- | src/buildstream/_workspaces.py | 2 | ||||
-rw-r--r-- | src/buildstream/_yaml.pxd | 2 | ||||
-rw-r--r-- | src/buildstream/_yaml.pyx | 12 | ||||
-rw-r--r-- | src/buildstream/element.py | 2 | ||||
-rw-r--r-- | src/buildstream/sandbox/_sandboxremote.py | 2 | ||||
-rw-r--r-- | src/buildstream/source.py | 4 | ||||
-rw-r--r-- | tests/artifactcache/junctions.py | 2 | ||||
-rw-r--r-- | tests/elements/filter/basic/element_plugins/dynamic.py | 4 | ||||
-rw-r--r-- | tests/frontend/workspace.py | 6 |
9 files changed, 18 insertions, 18 deletions
diff --git a/src/buildstream/_workspaces.py b/src/buildstream/_workspaces.py index d3a28b879..2d693c566 100644 --- a/src/buildstream/_workspaces.py +++ b/src/buildstream/_workspaces.py @@ -630,7 +630,7 @@ class Workspaces(): def _load_workspace(self, node): running_files = node.get_mapping('running_files', default=None) if running_files: - running_files = running_files.strip_node_info() + running_files = running_files._strip_node_info() dictionary = { 'prepared': node.get_bool('prepared', default=False), diff --git a/src/buildstream/_yaml.pxd b/src/buildstream/_yaml.pxd index 7aac91569..5bf3a7733 100644 --- a/src/buildstream/_yaml.pxd +++ b/src/buildstream/_yaml.pxd @@ -28,7 +28,7 @@ cdef class Node: cpdef Node copy(self) cpdef ProvenanceInformation get_provenance(self) - cpdef object strip_node_info(self) + cpdef object _strip_node_info(self) cpdef void _assert_fully_composited(self) except * cdef void _compose_on(self, str key, MappingNode target, list path) except * diff --git a/src/buildstream/_yaml.pyx b/src/buildstream/_yaml.pyx index 932d32db3..511a5d71a 100644 --- a/src/buildstream/_yaml.pyx +++ b/src/buildstream/_yaml.pyx @@ -91,7 +91,7 @@ cdef class Node: cpdef ProvenanceInformation get_provenance(self): return ProvenanceInformation(self) - cpdef object strip_node_info(self): + cpdef object _strip_node_info(self): raise NotImplementedError() # _assert_fully_composited() @@ -190,7 +190,7 @@ cdef class ScalarNode(Node): return None return str(self.value) - cpdef object strip_node_info(self): + cpdef object _strip_node_info(self): return self.value cpdef void _assert_fully_composited(self) except *: @@ -410,11 +410,11 @@ cdef class MappingNode(Node): cpdef object values(self): return self.value.values() - cpdef object strip_node_info(self): + cpdef object _strip_node_info(self): cdef str key cdef Node value - return {key: value.strip_node_info() for key, value in self.value.items()} + return {key: value._strip_node_info() for key, value in self.value.items()} cdef void __composite(self, MappingNode target, list path=None) except *: cdef str key @@ -657,9 +657,9 @@ cdef class SequenceNode(Node): cpdef list as_str_list(self): return [node.as_str() for node in self.value] - cpdef object strip_node_info(self): + cpdef object _strip_node_info(self): cdef Node value - return [value.strip_node_info() for value in self.value] + return [value._strip_node_info() for value in self.value] cpdef void _assert_fully_composited(self) except *: cdef Node value diff --git a/src/buildstream/element.py b/src/buildstream/element.py index c2c848fc1..f54e3bb22 100644 --- a/src/buildstream/element.py +++ b/src/buildstream/element.py @@ -2162,7 +2162,7 @@ class Element(Plugin): 'environment': cache_env, 'sources': [s._get_unique_key(workspace is None) for s in self.__sources], 'workspace': '' if workspace is None else workspace.get_key(self._get_project()), - 'public': self.__public.strip_node_info(), + 'public': self.__public._strip_node_info(), } self.__cache_key_dict['fatal-warnings'] = sorted(project._fatal_warnings) diff --git a/src/buildstream/sandbox/_sandboxremote.py b/src/buildstream/sandbox/_sandboxremote.py index 76b1a6270..fb45c72ef 100644 --- a/src/buildstream/sandbox/_sandboxremote.py +++ b/src/buildstream/sandbox/_sandboxremote.py @@ -176,7 +176,7 @@ class SandboxRemote(Sandbox): config[tls_key] = resolve_path(config.get_str(tls_key)) # TODO: we should probably not be stripping node info and rather load files the safe way - return RemoteExecutionSpec(*[conf.strip_node_info() for conf in service_configs]) + return RemoteExecutionSpec(*[conf._strip_node_info() for conf in service_configs]) def run_remote_command(self, channel, action_digest): # Sends an execution request to the remote execution server. diff --git a/src/buildstream/source.py b/src/buildstream/source.py index 3b47b55ea..2cfc23c58 100644 --- a/src/buildstream/source.py +++ b/src/buildstream/source.py @@ -888,8 +888,8 @@ class Source(Plugin): # Step 2 - Set the ref in memory, and determine changed state # # TODO: we are working on dictionaries here, would be nicer to just work on the nodes themselves - clean = node.strip_node_info() - to_modify = node.strip_node_info() + clean = node._strip_node_info() + to_modify = node._strip_node_info() current_ref = self.get_ref() # pylint: disable=assignment-from-no-return diff --git a/tests/artifactcache/junctions.py b/tests/artifactcache/junctions.py index 6170816c3..34d6916e8 100644 --- a/tests/artifactcache/junctions.py +++ b/tests/artifactcache/junctions.py @@ -24,7 +24,7 @@ def project_set_artifacts(project, url): 'url': url, 'push': True } - _yaml.roundtrip_dump(project_config.strip_node_info(), file=project_conf_file) + _yaml.roundtrip_dump(project_config._strip_node_info(), file=project_conf_file) @pytest.mark.datafiles(DATA_DIR) diff --git a/tests/elements/filter/basic/element_plugins/dynamic.py b/tests/elements/filter/basic/element_plugins/dynamic.py index 18e52c4b6..fe83d7295 100644 --- a/tests/elements/filter/basic/element_plugins/dynamic.py +++ b/tests/elements/filter/basic/element_plugins/dynamic.py @@ -5,13 +5,13 @@ from buildstream import Element, Scope class DynamicElement(Element): def configure(self, node): node.validate_keys(['split-rules']) - self.split_rules = node.get_mapping('split-rules') + self.split_rules = {key: value.as_str_list() for key, value in node.get_mapping('split-rules').items()} def preflight(self): pass def get_unique_key(self): - return {'split-rules': self.split_rules.strip_node_info()} + return {'split-rules': self.split_rules} def configure_sandbox(self, sandbox): pass diff --git a/tests/frontend/workspace.py b/tests/frontend/workspace.py index 9f8398d14..6e23ec488 100644 --- a/tests/frontend/workspace.py +++ b/tests/frontend/workspace.py @@ -908,7 +908,7 @@ def test_list_supported_workspace(cli, tmpdir, datafiles, workspace_cfg, expecte def parse_dict_as_yaml(node): tempfile = os.path.join(str(tmpdir), 'yaml_dump') _yaml.roundtrip_dump(node, tempfile) - return _yaml.load(tempfile).strip_node_info() + return _yaml.load(tempfile)._strip_node_info() project = str(datafiles) os.makedirs(os.path.join(project, '.bst')) @@ -920,7 +920,7 @@ def test_list_supported_workspace(cli, tmpdir, datafiles, workspace_cfg, expecte result = cli.run(project=project, args=['workspace', 'list']) result.assert_success() - loaded_config = _yaml.load(workspace_config_path).strip_node_info() + loaded_config = _yaml.load(workspace_config_path)._strip_node_info() # Check that workspace config remains the same if no modifications # to workspaces were made @@ -955,7 +955,7 @@ def test_list_supported_workspace(cli, tmpdir, datafiles, workspace_cfg, expecte result.assert_success() # Check that workspace config is converted correctly if necessary - loaded_config = _yaml.load(workspace_config_path).strip_node_info() + loaded_config = _yaml.load(workspace_config_path)._strip_node_info() assert loaded_config == parse_dict_as_yaml(expected) |