From 2d95b45f8d5bb3362a125efc4dc594c5e1690bac Mon Sep 17 00:00:00 2001 From: mandeep Date: Mon, 3 Jul 2017 13:40:54 -0500 Subject: [PATCH] Sort output metadata prior to writing to meta.yaml Added comments above metadata sorting block --- conda_build/build.py | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/conda_build/build.py b/conda_build/build.py index 44c52374c7..3f0d90ab62 100644 --- a/conda_build/build.py +++ b/conda_build/build.py @@ -211,6 +211,16 @@ def copy_recipe(m): if 'outputs' in output_metadata.meta: del output_metadata.meta['outputs'] + # each metadata field has a dict as a value and each value may contain + # a list of strings that need to be sorted alphabetically + for field, value in output_metadata.meta.items(): + for key in value.keys(): + if '{}/{}' .format(field, key) not in ('build/script', 'test/commands'): + try: + output_metadata.meta[field][key].sort() + except AttributeError: + pass + rendered = output_yaml(output_metadata) if not original_recipe or not open(original_recipe).read() == rendered: