conda-build icon indicating copy to clipboard operation
conda-build copied to clipboard

Custom yaml Loader

Open kenodegard opened this issue 4 years ago • 5 comments

This change was prompted by issues identified in #4179.

Instead of monkeypatching the yaml Loader every time it is used in an attempt to avoid parsing numbers make a custom Loader where the float/int tags are entirely removed.

This change also catches a number of cases that were previously missed. For example, pyyaml defined float resolvers for "-+0123456789." and int resolvers for "-+0123456789" and since the prior implementation only monkeypatched for "0123456789" it was still possible for numbers to be missed (e.g. ".0", "-1", "+1").

kenodegard avatar Jan 16 '21 20:01 kenodegard

Yay! All done here!

@mingwandroid - no rush just let me know if anything here needs further work/discussion.

kenodegard avatar Jan 21 '21 18:01 kenodegard

@kenodegard You identified a few cases that were previously missing, could you turn those cases into test cases please?

jezdez avatar Aug 26 '21 12:08 jezdez

Absolutely! I will need to revive some dormant brain cells first...

I'm assuming we'd want the tests written in test_metadata?

kenodegard avatar Aug 27 '21 18:08 kenodegard

@jezdez added a few simple tests that are just checking to see if any int/floats occur in the parsed yaml. The zero, positive, and negative tests all fail on master.

kenodegard avatar Sep 20 '21 23:09 kenodegard

@anaconda-issue-bot check

kenodegard avatar Oct 22 '21 21:10 kenodegard