README.rst 34 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779
  1. ruamel.yaml
  2. ===========
  3. ``ruamel.yaml`` is a YAML 1.2 loader/dumper package for Python.
  4. :version: 0.16.13
  5. :updated: 2021-03-05
  6. :documentation: http://yaml.readthedocs.io
  7. :repository: https://sourceforge.net/projects/ruamel-yaml/
  8. :pypi: https://pypi.org/project/ruamel.yaml/
  9. *The 0.16.13 release is the last that will tested to be working on Python 2.7.
  10. The 0.17 series will still be tested on Python 3.5, but the 0.18 will not. The
  11. 0.17 series will also stop support for the old PyYAML functions, so a `YAML()` instance
  12. will need to be created.*
  13. *Please adjust your dependencies accordingly if necessary.*
  14. Starting with version 0.15.0 the way YAML files are loaded and dumped
  15. is changing. See the API doc for details. Currently existing
  16. functionality will throw a warning before being changed/removed.
  17. **For production systems you should pin the version being used with
  18. ``ruamel.yaml<=0.15``**. There might be bug fixes in the 0.14 series,
  19. but new functionality is likely only to be available via the new API.
  20. If your package uses ``ruamel.yaml`` and is not listed on PyPI, drop
  21. me an email, preferably with some information on how you use the
  22. package (or a link to bitbucket/github) and I'll keep you informed
  23. when the status of the API is stable enough to make the transition.
  24. * `Overview <http://yaml.readthedocs.org/en/latest/overview.html>`_
  25. * `Installing <http://yaml.readthedocs.org/en/latest/install.html>`_
  26. * `Basic Usage <http://yaml.readthedocs.org/en/latest/basicuse.html>`_
  27. * `Details <http://yaml.readthedocs.org/en/latest/detail.html>`_
  28. * `Examples <http://yaml.readthedocs.org/en/latest/example.html>`_
  29. * `API <http://yaml.readthedocs.org/en/latest/api.html>`_
  30. * `Differences with PyYAML <http://yaml.readthedocs.org/en/latest/pyyaml.html>`_
  31. .. image:: https://readthedocs.org/projects/yaml/badge/?version=stable
  32. :target: https://yaml.readthedocs.org/en/stable
  33. .. image:: https://bestpractices.coreinfrastructure.org/projects/1128/badge
  34. :target: https://bestpractices.coreinfrastructure.org/projects/1128
  35. .. image:: https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/_doc/_static/license.svg?format=raw
  36. :target: https://opensource.org/licenses/MIT
  37. .. image:: https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/_doc/_static/pypi.svg?format=raw
  38. :target: https://pypi.org/project/ruamel.yaml/
  39. .. image:: https://sourceforge.net/p/oitnb/code/ci/default/tree/_doc/_static/oitnb.svg?format=raw
  40. :target: https://pypi.org/project/oitnb/
  41. .. image:: http://www.mypy-lang.org/static/mypy_badge.svg
  42. :target: http://mypy-lang.org/
  43. ChangeLog
  44. =========
  45. .. should insert NEXT: at the beginning of line for next key (with empty line)
  46. 0.16.13 (2021-03-05):
  47. - fix for issue 359: could not update() CommentedMap with keyword arguments
  48. (reported by `Steve Franchak <https://sourceforge.net/u/binaryadder/>`__)
  49. - fix for issue 365: unable to dump mutated TimeStamp objects
  50. (reported by Anton Akmerov <https://sourceforge.net/u/akhmerov/>`__)
  51. - fix for issue 371: unable to addd comment without starting space
  52. (reported by 'Mark Grandi <https://sourceforge.net/u/mgrandi>`__)
  53. - fix for issue 373: recursive call to walk_tree not preserving all params
  54. (reported by `eulores <https://sourceforge.net/u/eulores/>`__)
  55. - a None value in a flow-style sequence is now dumped as `null` instead
  56. of `!!null ''` (reported by mcarans on
  57. `StackOverlow <https://stackoverflow.com/a/66489600/1307905>`__)
  58. 0.16.12 (2020-09-04):
  59. - update links in doc
  60. 0.16.11 (2020-09-03):
  61. - workaround issue with setuptools 0.50 and importing pip ( fix by jaraco
  62. https://github.com/pypa/setuptools/issues/2355#issuecomment-685159580 )
  63. 0.16.10 (2020-02-12):
  64. - (auto) updated image references in README to sourceforge
  65. 0.16.9 (2020-02-11):
  66. - update CHANGES
  67. 0.16.8 (2020-02-11):
  68. - update requirements so that ruamel.yaml.clib is installed for 3.8,
  69. as it has become available (via manylinux builds)
  70. 0.16.7 (2020-01-30):
  71. - fix typchecking issue on TaggedScalar (reported by Jens Nielsen)
  72. - fix error in dumping literal scalar in sequence with comments before element
  73. (reported by `EJ Etherington <https://sourceforge.net/u/ejether/>`__)
  74. 0.16.6 (2020-01-20):
  75. - fix empty string mapping key roundtripping with preservation of quotes as `? ''`
  76. (reported via email by Tomer Aharoni).
  77. - fix incorrect state setting in class constructor (reported by `Douglas Raillard
  78. <https://bitbucket.org/%7Bcf052d92-a278-4339-9aa8-de41923bb556%7D/>`__)
  79. - adjust deprecation warning test for Hashable, as that no longer warns (reported
  80. by `Jason Montleon <https://bitbucket.org/%7B8f377d12-8d5b-4069-a662-00a2674fee4e%7D/>`__)
  81. 0.16.5 (2019-08-18):
  82. - allow for ``YAML(typ=['unsafe', 'pytypes'])``
  83. 0.16.4 (2019-08-16):
  84. - fix output of TAG directives with # (reported by `Thomas Smith
  85. <https://bitbucket.org/%7Bd4c57a72-f041-4843-8217-b4d48b6ece2f%7D/>`__)
  86. 0.16.3 (2019-08-15):
  87. - split construct_object
  88. - change stuff back to keep mypy happy
  89. - move setting of version based on YAML directive to scanner, allowing to
  90. check for file version during TAG directive scanning
  91. 0.16.2 (2019-08-15):
  92. - preserve YAML and TAG directives on roundtrip, correctly output #
  93. in URL for YAML 1.2 (both reported by `Thomas Smith
  94. <https://bitbucket.org/%7Bd4c57a72-f041-4843-8217-b4d48b6ece2f%7D/>`__)
  95. 0.16.1 (2019-08-08):
  96. - Force the use of new version of ruamel.yaml.clib (reported by `Alex Joz
  97. <https://bitbucket.org/%7B9af55900-2534-4212-976c-61339b6ffe14%7D/>`__)
  98. - Allow '#' in tag URI as these are allowed in YAML 1.2 (reported by
  99. `Thomas Smith
  100. <https://bitbucket.org/%7Bd4c57a72-f041-4843-8217-b4d48b6ece2f%7D/>`__)
  101. 0.16.0 (2019-07-25):
  102. - split of C source that generates .so file to ruamel.yaml.clib
  103. - duplicate keys are now an error when working with the old API as well
  104. 0.15.100 (2019-07-17):
  105. - fixing issue with dumping deep-copied data from commented YAML, by
  106. providing both the memo parameter to __deepcopy__, and by allowing
  107. startmarks to be compared on their content (reported by `Theofilos
  108. Petsios
  109. <https://bitbucket.org/%7Be550bc5d-403d-4fda-820b-bebbe71796d3%7D/>`__)
  110. 0.15.99 (2019-07-12):
  111. - add `py.typed` to distribution, based on a PR submitted by
  112. `Michael Crusoe
  113. <https://bitbucket.org/%7Bc9fbde69-e746-48f5-900d-34992b7860c8%7D/>`__
  114. - merge PR 40 (also by Michael Crusoe) to more accurately specify
  115. repository in the README (also reported in a misunderstood issue
  116. some time ago)
  117. 0.15.98 (2019-07-09):
  118. - regenerate ext/_ruamel_yaml.c with Cython version 0.29.12, needed
  119. for Python 3.8.0b2 (reported by `John Vandenberg
  120. <https://bitbucket.org/%7B6d4e8487-3c97-4dab-a060-088ec50c682c%7D/>`__)
  121. 0.15.97 (2019-06-06):
  122. - regenerate ext/_ruamel_yaml.c with Cython version 0.29.10, needed for
  123. Python 3.8.0b1
  124. - regenerate ext/_ruamel_yaml.c with Cython version 0.29.9, needed for
  125. Python 3.8.0a4 (reported by `Anthony Sottile
  126. <https://bitbucket.org/%7B569cc8ea-0d9e-41cb-94a4-19ea517324df%7D/>`__)
  127. 0.15.96 (2019-05-16):
  128. - fix failure to indent comments on round-trip anchored block style
  129. scalars in block sequence (reported by `William Kimball
  130. <https://bitbucket.org/%7Bba35ed20-4bb0-46f8-bb5d-c29871e86a22%7D/>`__)
  131. 0.15.95 (2019-05-16):
  132. - fix failure to round-trip anchored scalars in block sequence
  133. (reported by `William Kimball
  134. <https://bitbucket.org/%7Bba35ed20-4bb0-46f8-bb5d-c29871e86a22%7D/>`__)
  135. - wheel files for Python 3.4 no longer provided (`Python 3.4 EOL 2019-03-18
  136. <https://www.python.org/dev/peps/pep-0429/>`__)
  137. 0.15.94 (2019-04-23):
  138. - fix missing line-break after end-of-file comments not ending in
  139. line-break (reported by `Philip Thompson
  140. <https://bitbucket.org/%7Be42ba205-0876-4151-bcbe-ccaea5bd13ce%7D/>`__)
  141. 0.15.93 (2019-04-21):
  142. - fix failure to parse empty implicit flow mapping key
  143. - in YAML 1.1 plains scalars `y`, 'n', `Y`, and 'N' are now
  144. correctly recognised as booleans and such strings dumped quoted
  145. (reported by `Marcel Bollmann
  146. <https://bitbucket.org/%7Bd8850921-9145-4ad0-ac30-64c3bd9b036d%7D/>`__)
  147. 0.15.92 (2019-04-16):
  148. - fix failure to parse empty implicit block mapping key (reported by
  149. `Nolan W <https://bitbucket.org/i2labs/>`__)
  150. 0.15.91 (2019-04-05):
  151. - allowing duplicate keys would not work for merge keys (reported by mamacdon on
  152. `StackOverflow <https://stackoverflow.com/questions/55540686/>`__
  153. 0.15.90 (2019-04-04):
  154. - fix issue with updating `CommentedMap` from list of tuples (reported by
  155. `Peter Henry <https://bitbucket.org/mosbasik/>`__)
  156. 0.15.89 (2019-02-27):
  157. - fix for items with flow-mapping in block sequence output on single line
  158. (reported by `Zahari Dim <https://bitbucket.org/zahari_dim/>`__)
  159. - fix for safe dumping erroring in creation of representereror when dumping namedtuple
  160. (reported and solution by `Jaakko Kantojärvi <https://bitbucket.org/raphendyr/>`__)
  161. 0.15.88 (2019-02-12):
  162. - fix inclusing of python code from the subpackage data (containing extra tests,
  163. reported by `Florian Apolloner <https://bitbucket.org/apollo13/>`__)
  164. 0.15.87 (2019-01-22):
  165. - fix problem with empty lists and the code to reinsert merge keys (reported via email
  166. by Zaloo)
  167. 0.15.86 (2019-01-16):
  168. - reinsert merge key in its old position (reported by grumbler on
  169. `StackOverflow <https://stackoverflow.com/a/54206512/1307905>`__)
  170. - fix for issue with non-ASCII anchor names (reported and fix
  171. provided by Dandaleon Flux via email)
  172. - fix for issue when parsing flow mapping value starting with colon (in pure Python only)
  173. (reported by `FichteFoll <https://bitbucket.org/FichteFoll/>`__)
  174. 0.15.85 (2019-01-08):
  175. - the types used by ``SafeConstructor`` for mappings and sequences can
  176. now by set by assigning to ``XXXConstructor.yaml_base_dict_type``
  177. (and ``..._list_type``), preventing the need to copy two methods
  178. with 50+ lines that had ``var = {}`` hardcoded. (Implemented to
  179. help solve an feature request by `Anthony Sottile
  180. <https://bitbucket.org/asottile/>`__ in an easier way)
  181. 0.15.84 (2019-01-07):
  182. - fix for ``CommentedMap.copy()`` not returning ``CommentedMap``, let alone copying comments etc.
  183. (reported by `Anthony Sottile <https://bitbucket.org/asottile/>`__)
  184. 0.15.83 (2019-01-02):
  185. - fix for bug in roundtripping aliases used as key (reported via email by Zaloo)
  186. 0.15.82 (2018-12-28):
  187. - anchors and aliases on scalar int, float, string and bool are now preserved. Anchors
  188. do not need a referring alias for these (reported by
  189. `Alex Harvey <https://bitbucket.org/alexharv074/>`__)
  190. - anchors no longer lost on tagged objects when roundtripping (reported by `Zaloo
  191. <https://bitbucket.org/zaloo/>`__)
  192. 0.15.81 (2018-12-06):
  193. - fix issue dumping methods of metaclass derived classes (reported and fix provided
  194. by `Douglas Raillard <https://bitbucket.org/DouglasRaillard/>`__)
  195. 0.15.80 (2018-11-26):
  196. - fix issue emitting BEL character when round-tripping invalid folded input
  197. (reported by Isaac on `StackOverflow <https://stackoverflow.com/a/53471217/1307905>`__)
  198. 0.15.79 (2018-11-21):
  199. - fix issue with anchors nested deeper than alias (reported by gaFF on
  200. `StackOverflow <https://stackoverflow.com/a/53397781/1307905>`__)
  201. 0.15.78 (2018-11-15):
  202. - fix setup issue for 3.8 (reported by `Sidney Kuyateh
  203. <https://bitbucket.org/autinerd/>`__)
  204. 0.15.77 (2018-11-09):
  205. - setting `yaml.sort_base_mapping_type_on_output = False`, will prevent
  206. explicit sorting by keys in the base representer of mappings. Roundtrip
  207. already did not do this. Usage only makes real sense for Python 3.6+
  208. (feature request by `Sebastian Gerber <https://bitbucket.org/spacemanspiff2007/>`__).
  209. - implement Python version check in YAML metadata in ``_test/test_z_data.py``
  210. 0.15.76 (2018-11-01):
  211. - fix issue with empty mapping and sequence loaded as flow-style
  212. (mapping reported by `Min RK <https://bitbucket.org/minrk/>`__, sequence
  213. by `Maged Ahmed <https://bitbucket.org/maged2/>`__)
  214. 0.15.75 (2018-10-27):
  215. - fix issue with single '?' scalar (reported by `Terrance
  216. <https://bitbucket.org/OllieTerrance/>`__)
  217. - fix issue with duplicate merge keys (prompted by `answering
  218. <https://stackoverflow.com/a/52852106/1307905>`__ a
  219. `StackOverflow question <https://stackoverflow.com/q/52851168/1307905>`__
  220. by `math <https://stackoverflow.com/users/1355634/math>`__)
  221. 0.15.74 (2018-10-17):
  222. - fix dropping of comment on rt before sequence item that is sequence item
  223. (reported by `Thorsten Kampe <https://bitbucket.org/thorstenkampe/>`__)
  224. 0.15.73 (2018-10-16):
  225. - fix irregular output on pre-comment in sequence within sequence (reported
  226. by `Thorsten Kampe <https://bitbucket.org/thorstenkampe/>`__)
  227. - allow non-compact (i.e. next line) dumping sequence/mapping within sequence.
  228. 0.15.72 (2018-10-06):
  229. - fix regression on explicit 1.1 loading with the C based scanner/parser
  230. (reported by `Tomas Vavra <https://bitbucket.org/xtomik/>`__)
  231. 0.15.71 (2018-09-26):
  232. - some of the tests now live in YAML files in the
  233. `yaml.data <https://bitbucket.org/ruamel/yaml.data>`__ repository.
  234. ``_test/test_z_data.py`` processes these.
  235. - fix regression where handcrafted CommentedMaps could not be initiated (reported by
  236. `Dan Helfman <https://bitbucket.org/dhelfman/>`__)
  237. - fix regression with non-root literal scalars that needed indent indicator
  238. (reported by `Clark Breyman <https://bitbucket.org/clarkbreyman/>`__)
  239. - tag:yaml.org,2002:python/object/apply now also uses __qualname__ on PY3
  240. (reported by `Douglas RAILLARD <https://bitbucket.org/DouglasRaillard/>`__)
  241. - issue with self-referring object creation
  242. (reported and fix by `Douglas RAILLARD <https://bitbucket.org/DouglasRaillard/>`__)
  243. 0.15.70 (2018-09-21):
  244. - reverted CommentedMap and CommentedSeq to subclass ordereddict resp. list,
  245. reimplemented merge maps so that both ``dict(**commented_map_instance)`` and JSON
  246. dumping works. This also allows checking with ``isinstance()`` on ``dict`` resp. ``list``.
  247. (Proposed by `Stuart Berg <https://bitbucket.org/stuarteberg/>`__, with feedback
  248. from `blhsing <https://stackoverflow.com/users/6890912/blhsing>`__ on
  249. `StackOverflow <https://stackoverflow.com/q/52314186/1307905>`__)
  250. 0.15.69 (2018-09-20):
  251. - fix issue with dump_all gobbling end-of-document comments on parsing
  252. (reported by `Pierre B. <https://bitbucket.org/octplane/>`__)
  253. 0.15.68 (2018-09-20):
  254. - fix issue with parsabel, but incorrect output with nested flow-style sequences
  255. (reported by `Dougal Seeley <https://bitbucket.org/dseeley/>`__)
  256. - fix issue with loading Python objects that have __setstate__ and recursion in parameters
  257. (reported by `Douglas RAILLARD <https://bitbucket.org/DouglasRaillard/>`__)
  258. 0.15.67 (2018-09-19):
  259. - fix issue with extra space inserted with non-root literal strings
  260. (Issue reported and PR with fix provided by
  261. `Naomi Seyfer <https://bitbucket.org/sixolet/>`__.)
  262. 0.15.66 (2018-09-07):
  263. - fix issue with fold indicating characters inserted in safe_load-ed folded strings
  264. (reported by `Maximilian Hils <https://bitbucket.org/mhils/>`__).
  265. 0.15.65 (2018-09-07):
  266. - fix issue #232 revert to throw ParserError for unexcpected ``]``
  267. and ``}`` instead of IndexError. (Issue reported and PR with fix
  268. provided by `Naomi Seyfer <https://bitbucket.org/sixolet/>`__.)
  269. - added ``key`` and ``reverse`` parameter (suggested by Jannik Klemm via email)
  270. - indent root level literal scalars that have directive or document end markers
  271. at the beginning of a line
  272. 0.15.64 (2018-08-30):
  273. - support round-trip of tagged sequences: ``!Arg [a, {b: 1}]``
  274. - single entry mappings in flow sequences now written by default without braces,
  275. set ``yaml.brace_single_entry_mapping_in_flow_sequence=True`` to force
  276. getting ``[a, {b: 1}, {c: {d: 2}}]`` instead of the default ``[a, b: 1, c: {d: 2}]``
  277. - fix issue when roundtripping floats starting with a dot such as ``.5``
  278. (reported by `Harrison Gregg <https://bitbucket.org/HarrisonGregg/>`__)
  279. 0.15.63 (2018-08-29):
  280. - small fix only necessary for Windows users that don't use wheels.
  281. 0.15.62 (2018-08-29):
  282. - C based reader/scanner & emitter now allow setting of 1.2 as YAML version.
  283. ** The loading/dumping is still YAML 1.1 code**, so use the common subset of
  284. YAML 1.2 and 1.1 (reported by `Ge Yang <https://bitbucket.org/yangge/>`__)
  285. 0.15.61 (2018-08-23):
  286. - support for round-tripping folded style scalars (initially requested
  287. by `Johnathan Viduchinsky <https://bitbucket.org/johnathanvidu/>`__)
  288. - update of C code
  289. - speed up of scanning (~30% depending on the input)
  290. 0.15.60 (2018-08-18):
  291. - again allow single entry map in flow sequence context (reported by
  292. `Lee Goolsbee <https://bitbucket.org/lgoolsbee/>`__)
  293. - cleanup for mypy
  294. - spurious print in library (reported by
  295. `Lele Gaifax <https://bitbucket.org/lele/>`__), now automatically checked
  296. 0.15.59 (2018-08-17):
  297. - issue with C based loader and leading zeros (reported by
  298. `Tom Hamilton Stubber <https://bitbucket.org/TomHamiltonStubber/>`__)
  299. 0.15.58 (2018-08-17):
  300. - simple mappings can now be used as keys when round-tripping::
  301. {a: 1, b: 2}: hello world
  302. although using the obvious operations (del, popitem) on the key will
  303. fail, you can mutilate it by going through its attributes. If you load the
  304. above YAML in `d`, then changing the value is cumbersome:
  305. d = {CommentedKeyMap([('a', 1), ('b', 2)]): "goodbye"}
  306. and changing the key even more so:
  307. d[CommentedKeyMap([('b', 1), ('a', 2)])] = d.pop(
  308. CommentedKeyMap([('a', 1), ('b', 2)]))
  309. (you can use a `dict` instead of a list of tuples (or ordereddict), but that might result
  310. in a different order, of the keys of the key, in the output)
  311. - check integers to dump with 1.2 patterns instead of 1.1 (reported by
  312. `Lele Gaifax <https://bitbucket.org/lele/>`__)
  313. 0.15.57 (2018-08-15):
  314. - Fix that CommentedSeq could no longer be used in adding or do a sort
  315. (reported by `Christopher Wright <https://bitbucket.org/CJ-Wright4242/>`__)
  316. 0.15.56 (2018-08-15):
  317. - fix issue with ``python -O`` optimizing away code (reported, and detailed cause
  318. pinpointed, by `Alex Grönholm <https://bitbucket.org/agronholm/>`__)
  319. 0.15.55 (2018-08-14):
  320. - unmade ``CommentedSeq`` a subclass of ``list``. It is now
  321. indirectly a subclass of the standard
  322. ``collections.abc.MutableSequence`` (without .abc if you are
  323. still on Python2.7). If you do ``isinstance(yaml.load('[1, 2]'),
  324. list)``) anywhere in your code replace ``list`` with
  325. ``MutableSequence``. Directly, ``CommentedSeq`` is a subclass of
  326. the abstract baseclass ``ruamel.yaml.compat.MutableScliceableSequence``,
  327. with the result that *(extended) slicing is supported on
  328. ``CommentedSeq``*.
  329. (reported by `Stuart Berg <https://bitbucket.org/stuarteberg/>`__)
  330. - duplicate keys (or their values) with non-ascii now correctly
  331. report in Python2, instead of raising a Unicode error.
  332. (Reported by `Jonathan Pyle <https://bitbucket.org/jonathan_pyle/>`__)
  333. 0.15.54 (2018-08-13):
  334. - fix issue where a comment could pop-up twice in the output (reported by
  335. `Mike Kazantsev <https://bitbucket.org/mk_fg/>`__ and by
  336. `Nate Peterson <https://bitbucket.org/ndpete21/>`__)
  337. - fix issue where JSON object (mapping) without spaces was not parsed
  338. properly (reported by `Marc Schmidt <https://bitbucket.org/marcj/>`__)
  339. - fix issue where comments after empty flow-style mappings were not emitted
  340. (reported by `Qinfench Chen <https://bitbucket.org/flyin5ish/>`__)
  341. 0.15.53 (2018-08-12):
  342. - fix issue with flow style mapping with comments gobbled newline (reported
  343. by `Christopher Lambert <https://bitbucket.org/XN137/>`__)
  344. - fix issue where single '+' under YAML 1.2 was interpreted as
  345. integer, erroring out (reported by `Jethro Yu
  346. <https://bitbucket.org/jcppkkk/>`__)
  347. 0.15.52 (2018-08-09):
  348. - added `.copy()` mapping representation for round-tripping
  349. (``CommentedMap``) to fix incomplete copies of merged mappings
  350. (reported by `Will Richards
  351. <https://bitbucket.org/will_richards/>`__)
  352. - Also unmade that class a subclass of ordereddict to solve incorrect behaviour
  353. for ``{**merged-mapping}`` and ``dict(**merged-mapping)`` (reported independently by
  354. `Tim Olsson <https://bitbucket.org/tgolsson/>`__ and
  355. `Filip Matzner <https://bitbucket.org/FloopCZ/>`__)
  356. 0.15.51 (2018-08-08):
  357. - Fix method name dumps (were not dotted) and loads (reported by `Douglas Raillard
  358. <https://bitbucket.org/DouglasRaillard/>`__)
  359. - Fix spurious trailing white-space caused when the comment start
  360. column was no longer reached and there was no actual EOL comment
  361. (e.g. following empty line) and doing substitutions, or when
  362. quotes around scalars got dropped. (reported by `Thomas Guillet
  363. <https://bitbucket.org/guillett/>`__)
  364. 0.15.50 (2018-08-05):
  365. - Allow ``YAML()`` as a context manager for output, thereby making it much easier
  366. to generate multi-documents in a stream.
  367. - Fix issue with incorrect type information for `load()` and `dump()` (reported
  368. by `Jimbo Jim <https://bitbucket.org/jimbo1qaz/>`__)
  369. 0.15.49 (2018-08-05):
  370. - fix preservation of leading newlines in root level literal style scalar,
  371. and preserve comment after literal style indicator (``| # some comment``)
  372. Both needed for round-tripping multi-doc streams in
  373. `ryd <https://pypi.org/project/ryd/>`__.
  374. 0.15.48 (2018-08-03):
  375. - housekeeping: ``oitnb`` for formatting, mypy 0.620 upgrade and conformity
  376. 0.15.47 (2018-07-31):
  377. - fix broken 3.6 manylinux1, the result of an unclean ``build`` (reported by
  378. `Roman Sichnyi <https://bitbucket.org/rsichnyi-gl/>`__)
  379. 0.15.46 (2018-07-29):
  380. - fixed DeprecationWarning for importing from ``collections`` on 3.7
  381. (issue 210, reported by `Reinoud Elhorst
  382. <https://bitbucket.org/reinhrst/>`__). It was `difficult to find
  383. why tox/pytest did not report
  384. <https://stackoverflow.com/q/51573204/1307905>`__ and as time
  385. consuming to actually `fix
  386. <https://stackoverflow.com/a/51573205/1307905>`__ the tests.
  387. 0.15.45 (2018-07-26):
  388. - After adding failing test for ``YAML.load_all(Path())``, remove StopIteration
  389. (PR provided by `Zachary Buhman <https://bitbucket.org/buhman/>`__,
  390. also reported by `Steven Hiscocks <https://bitbucket.org/sdhiscocks/>`__.
  391. 0.15.44 (2018-07-14):
  392. - Correct loading plain scalars consisting of numerals only and
  393. starting with `0`, when not explicitly specifying YAML version
  394. 1.1. This also fixes the issue about dumping string `'019'` as
  395. plain scalars as reported by `Min RK
  396. <https://bitbucket.org/minrk/>`__, that prompted this chance.
  397. 0.15.43 (2018-07-12):
  398. - merge PR33: Python2.7 on Windows is narrow, but has no
  399. ``sysconfig.get_config_var('Py_UNICODE_SIZE')``. (merge provided by
  400. `Marcel Bargull <https://bitbucket.org/mbargull/>`__)
  401. - ``register_class()`` now returns class (proposed by
  402. `Mike Nerone <https://bitbucket.org/Manganeez/>`__}
  403. 0.15.42 (2018-07-01):
  404. - fix regression showing only on narrow Python 2.7 (py27mu) builds
  405. (with help from
  406. `Marcel Bargull <https://bitbucket.org/mbargull/>`__ and
  407. `Colm O'Connor <https://bitbucket.org/colmoconnorgithub/>`__).
  408. - run pre-commit ``tox`` on Python 2.7 wide and narrow, as well as
  409. 3.4/3.5/3.6/3.7/pypy
  410. 0.15.41 (2018-06-27):
  411. - add detection of C-compile failure (investigation prompted by
  412. `StackOverlow <https://stackoverflow.com/a/51057399/1307905>`__ by
  413. `Emmanuel Blot <https://stackoverflow.com/users/8233409/emmanuel-blot>`__),
  414. which was removed while no longer dependent on ``libyaml``, C-extensions
  415. compilation still needs a compiler though.
  416. 0.15.40 (2018-06-18):
  417. - added links to landing places as suggested in issue 190 by
  418. `KostisA <https://bitbucket.org/ankostis/>`__
  419. - fixes issue #201: decoding unicode escaped tags on Python2, reported
  420. by `Dan Abolafia <https://bitbucket.org/danabo/>`__
  421. 0.15.39 (2018-06-17):
  422. - merge PR27 improving package startup time (and loading when regexp not
  423. actually used), provided by
  424. `Marcel Bargull <https://bitbucket.org/mbargull/>`__
  425. 0.15.38 (2018-06-13):
  426. - fix for losing precision when roundtripping floats by
  427. `Rolf Wojtech <https://bitbucket.org/asomov/>`__
  428. - fix for hardcoded dir separator not working for Windows by
  429. `Nuno André <https://bitbucket.org/nu_no/>`__
  430. - typo fix by `Andrey Somov <https://bitbucket.org/asomov/>`__
  431. 0.15.37 (2018-03-21):
  432. - again trying to create installable files for 187
  433. 0.15.36 (2018-02-07):
  434. - fix issue 187, incompatibility of C extension with 3.7 (reported by
  435. Daniel Blanchard)
  436. 0.15.35 (2017-12-03):
  437. - allow ``None`` as stream when specifying ``transform`` parameters to
  438. ``YAML.dump()``.
  439. This is useful if the transforming function doesn't return a meaningful value
  440. (inspired by `StackOverflow <https://stackoverflow.com/q/47614862/1307905>`__ by
  441. `rsaw <https://stackoverflow.com/users/406281/rsaw>`__).
  442. 0.15.34 (2017-09-17):
  443. - fix for issue 157: CDumper not dumping floats (reported by Jan Smitka)
  444. 0.15.33 (2017-08-31):
  445. - support for "undefined" round-tripping tagged scalar objects (in addition to
  446. tagged mapping object). Inspired by a use case presented by Matthew Patton
  447. on `StackOverflow <https://stackoverflow.com/a/45967047/1307905>`__.
  448. - fix issue 148: replace cryptic error message when using !!timestamp with an
  449. incorrectly formatted or non- scalar. Reported by FichteFoll.
  450. 0.15.32 (2017-08-21):
  451. - allow setting ``yaml.default_flow_style = None`` (default: ``False``) for
  452. for ``typ='rt'``.
  453. - fix for issue 149: multiplications on ``ScalarFloat`` now return ``float``
  454. (reported by jan.brezina@tul.cz)
  455. 0.15.31 (2017-08-15):
  456. - fix Comment dumping
  457. 0.15.30 (2017-08-14):
  458. - fix for issue with "compact JSON" not parsing: ``{"in":{},"out":{}}``
  459. (reported on `StackOverflow <https://stackoverflow.com/q/45681626/1307905>`__ by
  460. `mjalkio <https://stackoverflow.com/users/5130525/mjalkio>`_
  461. 0.15.29 (2017-08-14):
  462. - fix issue #51: different indents for mappings and sequences (reported by
  463. Alex Harvey)
  464. - fix for flow sequence/mapping as element/value of block sequence with
  465. sequence-indent minus dash-offset not equal two.
  466. 0.15.28 (2017-08-13):
  467. - fix issue #61: merge of merge cannot be __repr__-ed (reported by Tal Liron)
  468. 0.15.27 (2017-08-13):
  469. - fix issue 62, YAML 1.2 allows ``?`` and ``:`` in plain scalars if non-ambigious
  470. (reported by nowox)
  471. - fix lists within lists which would make comments disappear
  472. 0.15.26 (2017-08-10):
  473. - fix for disappearing comment after empty flow sequence (reported by
  474. oit-tzhimmash)
  475. 0.15.25 (2017-08-09):
  476. - fix for problem with dumping (unloaded) floats (reported by eyenseo)
  477. 0.15.24 (2017-08-09):
  478. - added ScalarFloat which supports roundtripping of 23.1, 23.100,
  479. 42.00E+56, 0.0, -0.0 etc. while keeping the format. Underscores in mantissas
  480. are not preserved/supported (yet, is anybody using that?).
  481. - (finally) fixed longstanding issue 23 (reported by `Antony Sottile
  482. <https://bitbucket.org/asottile/>`__), now handling comment between block
  483. mapping key and value correctly
  484. - warn on YAML 1.1 float input that is incorrect (triggered by invalid YAML
  485. provided by Cecil Curry)
  486. - allow setting of boolean representation (`false`, `true`) by using:
  487. ``yaml.boolean_representation = [u'False', u'True']``
  488. 0.15.23 (2017-08-01):
  489. - fix for round_tripping integers on 2.7.X > sys.maxint (reported by ccatterina)
  490. 0.15.22 (2017-07-28):
  491. - fix for round_tripping singe excl. mark tags doubling (reported and fix by Jan Brezina)
  492. 0.15.21 (2017-07-25):
  493. - fix for writing unicode in new API, (reported on
  494. `StackOverflow <https://stackoverflow.com/a/45281922/1307905>`__
  495. 0.15.20 (2017-07-23):
  496. - wheels for windows including C extensions
  497. 0.15.19 (2017-07-13):
  498. - added object constructor for rt, decorator ``yaml_object`` to replace YAMLObject.
  499. - fix for problem using load_all with Path() instance
  500. - fix for load_all in combination with zero indent block style literal
  501. (``pure=True`` only!)
  502. 0.15.18 (2017-07-04):
  503. - missing ``pure`` attribute on ``YAML`` useful for implementing `!include` tag
  504. constructor for `including YAML files in a YAML file
  505. <https://stackoverflow.com/a/44913652/1307905>`__
  506. - some documentation improvements
  507. - trigger of doc build on new revision
  508. 0.15.17 (2017-07-03):
  509. - support for Unicode supplementary Plane **output**
  510. (input was already supported, triggered by
  511. `this <https://stackoverflow.com/a/44875714/1307905>`__ Stack Overflow Q&A)
  512. 0.15.16 (2017-07-01):
  513. - minor typing issues (reported and fix provided by
  514. `Manvendra Singh <https://bitbucket.org/manu-chroma/>`__
  515. - small doc improvements
  516. 0.15.15 (2017-06-27):
  517. - fix for issue 135, typ='safe' not dumping in Python 2.7
  518. (reported by Andrzej Ostrowski <https://bitbucket.org/aostr123/>`__)
  519. 0.15.14 (2017-06-25):
  520. - fix for issue 133, in setup.py: change ModuleNotFoundError to
  521. ImportError (reported and fix by
  522. `Asley Drake <https://github.com/aldraco>`__)
  523. 0.15.13 (2017-06-24):
  524. - suppress duplicate key warning on mappings with merge keys (reported by
  525. Cameron Sweeney)
  526. 0.15.12 (2017-06-24):
  527. - remove fatal dependency of setup.py on wheel package (reported by
  528. Cameron Sweeney)
  529. 0.15.11 (2017-06-24):
  530. - fix for issue 130, regression in nested merge keys (reported by
  531. `David Fee <https://bitbucket.org/dfee/>`__)
  532. 0.15.10 (2017-06-23):
  533. - top level PreservedScalarString not indented if not explicitly asked to
  534. - remove Makefile (not very useful anyway)
  535. - some mypy additions
  536. 0.15.9 (2017-06-16):
  537. - fix for issue 127: tagged scalars were always quoted and seperated
  538. by a newline when in a block sequence (reported and largely fixed by
  539. `Tommy Wang <https://bitbucket.org/twang817/>`__)
  540. 0.15.8 (2017-06-15):
  541. - allow plug-in install via ``install ruamel.yaml[jinja2]``
  542. 0.15.7 (2017-06-14):
  543. - add plug-in mechanism for load/dump pre resp. post-processing
  544. 0.15.6 (2017-06-10):
  545. - a set() with duplicate elements now throws error in rt loading
  546. - support for toplevel column zero literal/folded scalar in explicit documents
  547. 0.15.5 (2017-06-08):
  548. - repeat `load()` on a single `YAML()` instance would fail.
  549. 0.15.4 (2017-06-08):
  550. - `transform` parameter on dump that expects a function taking a
  551. string and returning a string. This allows transformation of the output
  552. before it is written to stream. This forces creation of the complete output in memory!
  553. - some updates to the docs
  554. 0.15.3 (2017-06-07):
  555. - No longer try to compile C extensions on Windows. Compilation can be forced by setting
  556. the environment variable `RUAMEL_FORCE_EXT_BUILD` to some value
  557. before starting the `pip install`.
  558. 0.15.2 (2017-06-07):
  559. - update to conform to mypy 0.511: mypy --strict
  560. 0.15.1 (2017-06-07):
  561. - `duplicate keys <http://yaml.readthedocs.io/en/latest/api.html#duplicate-keys>`__
  562. in mappings generate an error (in the old API this change generates a warning until 0.16)
  563. - dependecy on ruamel.ordereddict for 2.7 now via extras_require
  564. 0.15.0 (2017-06-04):
  565. - it is now allowed to pass in a ``pathlib.Path`` as "stream" parameter to all
  566. load/dump functions
  567. - passing in a non-supported object (e.g. a string) as "stream" will result in a
  568. much more meaningful YAMLStreamError.
  569. - assigning a normal string value to an existing CommentedMap key or CommentedSeq
  570. element will result in a value cast to the previous value's type if possible.
  571. - added ``YAML`` class for new API
  572. 0.14.12 (2017-05-14):
  573. - fix for issue 119, deepcopy not returning subclasses (reported and PR by
  574. Constantine Evans <cevans@evanslabs.org>)
  575. 0.14.11 (2017-05-01):
  576. - fix for issue 103 allowing implicit documents after document end marker line (``...``)
  577. in YAML 1.2
  578. 0.14.10 (2017-04-26):
  579. - fix problem with emitting using cyaml
  580. 0.14.9 (2017-04-22):
  581. - remove dependency on ``typing`` while still supporting ``mypy``
  582. (http://stackoverflow.com/a/43516781/1307905)
  583. - fix unclarity in doc that stated 2.6 is supported (reported by feetdust)
  584. 0.14.8 (2017-04-19):
  585. - fix Text not available on 3.5.0 and 3.5.1, now proactively setting version guards
  586. on all files (reported by `João Paulo Magalhães <https://bitbucket.org/jpmag/>`__)
  587. 0.14.7 (2017-04-18):
  588. - round trip of integers (decimal, octal, hex, binary) now preserve
  589. leading zero(s) padding and underscores. Underscores are presumed
  590. to be at regular distances (i.e. ``0o12_345_67`` dumps back as
  591. ``0o1_23_45_67`` as the space from the last digit to the
  592. underscore before that is the determining factor).
  593. 0.14.6 (2017-04-14):
  594. - binary, octal and hex integers are now preserved by default. This
  595. was a known deficiency. Working on this was prompted by the issue report (112)
  596. from devnoname120, as well as the additional experience with `.replace()`
  597. on `scalarstring` classes.
  598. - fix issues 114: cannot install on Buildozer (reported by mixmastamyk).
  599. Setting env. var ``RUAMEL_NO_PIP_INSTALL_CHECK`` will suppress ``pip``-check.
  600. 0.14.5 (2017-04-04):
  601. - fix issue 109: None not dumping correctly at top level (reported by Andrea Censi)
  602. - fix issue 110: .replace on Preserved/DoubleQuoted/SingleQuoted ScalarString
  603. would give back "normal" string (reported by sandres23)
  604. 0.14.4 (2017-03-31):
  605. - fix readme
  606. 0.14.3 (2017-03-31):
  607. - fix for 0o52 not being a string in YAML 1.1 (reported on
  608. `StackOverflow Q&A 43138503 <http://stackoverflow.com/a/43138503/1307905>`__ by
  609. `Frank D <http://stackoverflow.com/users/7796630/frank-d>`__)
  610. 0.14.2 (2017-03-23):
  611. - fix for old default pip on Ubuntu 14.04 (reported by Sébastien Maccagnoni-Munch)
  612. 0.14.1 (2017-03-22):
  613. - fix Text not available on 3.5.0 and 3.5.1 (reported by Charles Bouchard-Légaré)
  614. 0.14.0 (2017-03-21):
  615. - updates for mypy --strict
  616. - preparation for moving away from inheritance in Loader and Dumper, calls from e.g.
  617. the Representer to the Serializer.serialize() are now done via the attribute
  618. .serializer.serialize(). Usage of .serialize() outside of Serializer will be
  619. deprecated soon
  620. - some extra tests on main.py functions
  621. ----
  622. For older changes see the file
  623. `CHANGES <https://bitbucket.org/ruamel/yaml/src/default/CHANGES>`_