Skip to content

Commit

Permalink
Sort output metadata prior to writing to meta.yaml
Browse files Browse the repository at this point in the history
Added comments above metadata sorting block
  • Loading branch information
mandeep committed Jul 3, 2017
1 parent 8004846 commit 2d95b45
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions conda_build/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down

0 comments on commit 2d95b45

Please sign in to comment.