sergiocorreia / panflute

An Pythonic alternative to John MacFarlane's pandocfilters, with extra helper functions
http://scorreia.com/software/panflute/
BSD 3-Clause "New" or "Revised" License
500 stars 59 forks source link

Upgrading YAML spec from 1.1 to 1.2? #178

Closed ickc closed 3 years ago

ickc commented 3 years ago

by switching dependency from pyyaml to ruamel.yaml.

Not actionable for now as we should wait for a final decision from upstream. c.f. https://github.com/jgm/pandoc/issues/4535

TL;DR: pandoc switch from YAML 1.1 to 1.2 recently, but option is still open to revert that change. If the final decision is to stay with HsYAML with YAML 1.2 spec, then I think we should migrate to YAML 1.2 too to have a more uniform YAML experience (e.g. YAML codeblock in panflute do our own YAML parsing.)

ruamel.yaml is a fork of pyyaml, which also has a fork of libyaml which implements YAML 1.2. ruamel.yaml has a different API recently, but shouldn't be a big problem. Also, it has widely been used and supported, e.g. in conda-forge both share the same support across platforms. In my own testing ruamel.yaml is about a factor of 2 slower than pyyaml, and both grows roughly linear time.

More info (copy from my https://github.com/jgm/pandoc/issues/4535#issuecomment-748020730):

Edit: see https://gist.github.com/ickc/f9d6c57338d4be07f6cf70991d462fc3 for a benchmark. (You cannot see the plot using the rendering on GitHub directly.)

ickc commented 3 years ago

Upstream decided to switch bach to YAML 1.1.

See

jgm commented 3 years ago

Note, no decision has been made yet. We have a PR but it hasn't been merged.