`get_unique_key()` only works with an incorrectly initialised dictionary

The function get_unique_key(self) found here: https://gitlab.com/BuildStream/buildstream/blob/master/buildstream/plugins/elements/compose.py#L75 initialises a dictionary called "key" like this:

key = {}
key['integrate'] = self.integration, #NOTICE THE COMMA
key['include'] = sorted(self.include), #NOTICE THE COMMA
key['orphans'] = self.include_orphans

# Above returns: {'orphans': True, 'include': ([],), 'integrate': (True,)}
# Notice the tuple packing due to the commas 

The correct way to initialise such a dictionary would be without the commas, or more simply:

key = {'integrate': self.integration,
'include': sorted(self.include),
'orphans': self.include_orphans}

#Above returns: {'integrate': True, 'orphans': True, 'include': []}

However, such initialisation will fail the tests/cachekey/cachekey.py integration test and produce the following error:

====================================================================== FAILURES ======================================================================
___________________________________________________________________ test_cache_key ___________________________________________________________________

datafiles = local('/home/jamesennis/buildstream/tmp/test_cache_key0'), cli = <tests.testutils.runcli.Cli object at 0x7f7153a99f28>

    @pytest.mark.skipif(not IS_LINUX, reason='Only available on linux')
    @pytest.mark.skipif(HAVE_BZR is False, reason="bzr is not available")
    @pytest.mark.skipif(HAVE_GIT is False, reason="git is not available")
    @pytest.mark.skipif(HAVE_OSTREE is False, reason="ostree is not available")
    @pytest.mark.datafiles(DATA_DIR)
    def test_cache_key(datafiles, cli):
        project = os.path.join(datafiles.dirname, datafiles.basename)
    
        # Workaround bug in recent versions of setuptools: newer
        # versions of setuptools fail to preserve symbolic links
        # when creating a source distribution, causing this test
        # to fail from a dist tarball.
        goodbye_link = os.path.join(project, 'files', 'local',
                                    'usr', 'bin', 'goodbye')
        os.unlink(goodbye_link)
        os.symlink('hello', goodbye_link)
    
        result = cli.run(project=project, silent=True, args=[
            'show',
            '--format', '%{name}::%{full-key}',
            'target.bst'
        ])
        result.assert_success()
>       assert_cache_keys(project, result.output)

tests/cachekey/cachekey.py:169: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

project_dir = '/home/jamesennis/buildstream/tmp/test_cache_key0'
output = 'elements/build1.bst::4fa7a6fd4c7a499208be4ce0deb26f7ae2fad3bfe2a0579f95207e01189731f4\nelements/import1.bst::40e28a44...6339403a5d7bf8fd84569781354e2e457e989e\ntarget.bst::ad24471b89fa5fa27ea4d355e13a687e91d2cd55aad051230190b495d2e0044a\n'

    def assert_cache_keys(project_dir, output):
    
        # Read in the expected keys from the cache key test directory
        # and parse the actual keys from the `bst show` output
        #
        actual_keys = parse_output_keys(output)
        expected_keys = load_expected_keys(project_dir, actual_keys)
        mismatches = []
    
        for element_name in actual_keys:
            if actual_keys[element_name] != expected_keys[element_name]:
                mismatches.append(element_name)
    
        if mismatches:
            info = ""
            for element_name in mismatches:
                info += "  Element: {}\n".format(element_name) + \
                        "    Expected: {}\n".format(expected_keys[element_name]) + \
                        "    Actual: {}\n".format(actual_keys[element_name])
    
            raise AssertionError("Cache key mismatches occurred:\n{}\n".format(info) +
                                 "Use tests/cachekey/update.py to automatically " +
>                                "update this test case")
E           AssertionError: Cache key mismatches occurred:
E             Element: elements/compose1.bst
E               Expected: b2c1793a0cac24d0338da922de2b4890a831fe98a67248e90f1ff350d140a78d
E               Actual: 394871caf40e79818d09b8e651b5baa1cb812d84716f4adb87cb1ca2f51a418b
E             Element: elements/compose2.bst
E               Expected: 95400860f5f65338faa533958403f9a39baaaa68a20ea62bf88b041042108228
E               Actual: 78ca65e94d5fe39e67a7921cd2faf0bf8313a13a6a70e77d589ebd6d7128bf90
E             Element: elements/compose3.bst
E               Expected: 599097cc224cc8bb92a946de9a87cf3640e869957659af9027c6e4b8703fb2ef
E               Actual: 3e047a78d886427ccccfccb5f8ad22ac5c79676869e9ad6929e9f1379a57905e
E             Element: elements/compose4.bst
E               Expected: a2d0ac6ba12a706d6fc640502a42d17928796b549eb2d49103b5593d14bd5b2e
E               Actual: f41e670c67375c793f64b9230d19cfcd81b7d31df71be150f98b414bd917a424
E             Element: elements/compose5.bst
E               Expected: 6fd8485668c7028cc69f720b7fa3d8dbd47799a58ab2e943003af76d75723aca
E               Actual: 3a492fc57b9a99af1caef95c537c8fab4e183c7e32b1ea812201dc1058229136
E             Element: target.bst
E               Expected: 39b234fe293405fc9ea9a7a1d6f61c2b3555d3522704b75238d99b22476fadf8
E               Actual: ad24471b89fa5fa27ea4d355e13a687e91d2cd55aad051230190b495d2e0044a
E           
E           Use tests/cachekey/update.py to automatically update this test case

tests/cachekey/cachekey.py:129: AssertionError

The problem

Using the correct initialisation of the dictionary (without the tuple packing) fails this test and raises the above error.

Doing what the AssertionError suggests: "Use tests/cachekey/update.py to automatically update this test case" will temporarily solve the issue and pass the tests.

However, no .bst files were modified and so the cache keys should not have changed -> hence this is not a good solution.