METADATA 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317
  1. Metadata-Version: 2.4
  2. Name: ruamel.yaml
  3. Version: 0.19.1
  4. Summary: ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order
  5. Author: Anthon van der Neut
  6. Author-email: a.van.der.neut@ruamel.eu
  7. License: MIT
  8. Project-URL: Home, https://sourceforge.net/p/ruamel-yaml/
  9. Project-URL: Source, https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/
  10. Project-URL: Tracker, https://sourceforge.net/p/ruamel-yaml/tickets/
  11. Project-URL: Documentation, https://yaml.dev/doc/ruamel.yaml
  12. Keywords: yaml 1.2 parser round-trip preserve quotes order config
  13. Classifier: Development Status :: 4 - Beta
  14. Classifier: Intended Audience :: Developers
  15. Classifier: License :: OSI Approved :: MIT License
  16. Classifier: Operating System :: OS Independent
  17. Classifier: Programming Language :: Python
  18. Classifier: Programming Language :: Python :: 3.9
  19. Classifier: Programming Language :: Python :: 3.10
  20. Classifier: Programming Language :: Python :: 3.11
  21. Classifier: Programming Language :: Python :: 3.12
  22. Classifier: Programming Language :: Python :: 3.13
  23. Classifier: Programming Language :: Python :: 3.14
  24. Classifier: Programming Language :: Python :: Implementation :: CPython
  25. Classifier: Topic :: Software Development :: Libraries :: Python Modules
  26. Classifier: Topic :: Text Processing :: Markup
  27. Classifier: Typing :: Typed
  28. Requires-Python: >=3.9
  29. Description-Content-Type: text/markdown; charset=UTF-8; variant=CommonMark
  30. License-File: LICENSE
  31. Provides-Extra: oldlibyaml
  32. Requires-Dist: ruamel.yaml.clib; platform_python_implementation == "CPython" and extra == "oldlibyaml"
  33. Provides-Extra: libyaml
  34. Requires-Dist: ruamel.yaml.clibz>=0.3.7; platform_python_implementation == "CPython" and extra == "libyaml"
  35. Provides-Extra: jinja2
  36. Requires-Dist: ruamel.yaml.jinja2>=0.2; extra == "jinja2"
  37. Provides-Extra: docs
  38. Requires-Dist: ryd; extra == "docs"
  39. Requires-Dist: mercurial>5.7; extra == "docs"
  40. Dynamic: author
  41. Dynamic: author-email
  42. Dynamic: classifier
  43. Dynamic: description
  44. Dynamic: description-content-type
  45. Dynamic: keywords
  46. Dynamic: license
  47. Dynamic: license-file
  48. Dynamic: project-url
  49. Dynamic: provides-extra
  50. Dynamic: requires-python
  51. Dynamic: summary
  52. # ruamel.yaml
  53. `ruamel.yaml` is a YAML 1.2 loader/dumper package for Python.
  54. | | |
  55. | - | - |
  56. | version |0.19.0 |
  57. | updated |2025-01-02 |
  58. | documentation |https://yaml.dev/doc/ruamel.yaml |
  59. | repository |https://sourceforge.net/projects/ruamel-yaml |
  60. | pypi |https://pypi.org/project/ruamel.yaml |
  61. ## breaking changes, that may make future uploads to PyPI impossible
  62. *If you are interested in future upgrades of `ruamel.yaml`
  63. please check the [documentation on installing](https://yaml.dev/doc/ruamel.yaml/install/),
  64. since at some point I might not be able to upload a new version to PyPI with updated information.*
  65. `ruamel.yaml` was intentionally named as `yaml` in a namespace `ruamel`. The namespace allows the installation
  66. name to correspond unchanged to how the package is imported, reduces the number of links I have to create
  67. in site-packages of a Python install during development, as well as providing a recognisable set of packages
  68. my company releases to the public.
  69. However, after uploading version 0.18.7, I got an email from PyPI, about having to change the project name
  70. to `ruamel_yaml` to comply with PEP 625, sometime in the future. The email doesn't say if namespace packages are
  71. no longer allowed, or how to deal with the very real clash with the pre-existing package `ruamel_yaml`.
  72. I might not be able to adapt `ruamel.yaml`, in
  73. a way that does not negatively affect the 0.5 million daily downloads (and my own usage of the package) in time.
  74. My experience with other such service downgrades (Bitbucket, Readthedocs), has not been entirely positive.
  75. -----
  76. Starting with 0.19.1 `ruamel.yaml` no longer has a dependency on `ruamel.yaml.clibz`
  77. nor on the old `ruamel.yaml.clib`.
  78. Some deployment issues were reported on 0.19.0, due to the lack of proper pinning of the
  79. `ruamel.yaml` version used. Most of these issues had to do with
  80. the environment not having updated `setuptools` installed and the build
  81. dependency `setuptools-zig` for `ruamel.yaml.clibz` not being invoked, with
  82. Python falling back to invoking gcc (which was even less likely to be installed).
  83. The already indicated simple solution of using:
  84. ```
  85. python -m pip install --no-deps ruamel.yaml ruamel.yaml.clib
  86. ```
  87. turned out not to work for at least one setup.
  88. As I am not aware that you can create an install requirement that removes
  89. a dependency, the default (Cython) dependency is removed and you should
  90. use `ruamel.yaml[libyaml]` resp. `ruamel.yaml[oldlibyaml]` as your requirements.
  91. (this is the preferred way over using `ruamel.yaml.clibz` and `ruamel.yaml.clib`
  92. directly).
  93. If you are using `ruamel.yaml` in its default (round-trip, `YAML(typ='rt')`) mode,
  94. there is currently no advantage of installing either optional extension.
  95. The C sources are functionally unchanged,
  96. but they are now always compiled (using `setuptools-zig` and `ziglang`) on your system,
  97. instead of being downloaded as pre-compiled wheels (if available).
  98. For this to function properly your Python (virtual) environment needs to have
  99. an up-to-date version of `setuptools` and `wheels` pre-installed.
  100. The code to load `ruamel.yaml.clib` has priority over `ruamel.yaml.clibz`
  101. if both are installed.
  102. This compatibility will at least be available during the 0.19 `ruamel.yaml` series
  103. (so pin your usage of `ruamel.yaml` if necessary and report any problems).
  104. The motivitation for this change is the availability,
  105. and easy of use, of Zig as the toolchain
  106. (in the form of `ziglang` on PyPi), so lenghty, non-optimized,
  107. pre-compilation and uploading to PyPI,
  108. is no longer necessary.
  109. The time spent on creating ~60 wheels
  110. and even more time wasted on dealing with CI providers (Appveyor
  111. not being updated to support 3.14, Github CI being slow,
  112. and charging for the use of your own computer,
  113. etc).
  114. The split out of `ruamel.yaml.clib` after the 0.15.100 release,
  115. was also motivated by the time spent
  116. on generating .whl files even if only Python code was changed.
  117. The use of `ziglang` and `setuptools-zig` does make re-integration of the C sources
  118. into `ruamel.yaml` feasable, but there are no plans yet to make this happen.
  119. The test matrix for `ruamel.yaml.clibz`, of course still has many dimensions:
  120. ```
  121. Python versions: 3.9 - 3.14
  122. OS-es: Linux, Alpine (musl), macOS, Windows
  123. Architectures: Intel/AMD, Arm (and others), in 64 and some also in 32 bit versions
  124. Zig version: ziglang < 0.16 is taken from PyPI
  125. ```
  126. I try to test as much of the combinations as possible,
  127. trying at least all supported Python versions,
  128. including freethreading,
  129. on macOS-arm64,
  130. Linux arm64 (via docker containers),
  131. Ubuntu Linux-Intel,
  132. Linux musl intel (docker).
  133. And at least one Python version along each of the indicated positions of the
  134. dimensions above (e.g. Windows10 64bit was tested with Python 3.14, but I
  135. could not test the RISC-V architecture).
  136. As with generating .whl files previously
  137. (which I could not all test myself)
  138. I partly have to rely on the process of compilation/generation being likely correct,
  139. and feedback from actual users,
  140. of exotic (for me) platforms, is of course welcome.
  141. There is new section,
  142. in the documentation,
  143. on the security of processing unchecked input.
  144. -------
  145. The potentially breaking change announced for the 0.18 series, in that `YAML(typ='unsafe')`
  146. was going to be deprecated (now pending), has not yet been implemented, but is still considered.
  147. If you only use `unsafe` to dump, please use the new `YAML(typ='full')`, the result of that can be *safely*
  148. loaded with a default instance `YAML()`, as that will get you inspectable, tagged, scalars, instead of
  149. executed Python functions/classes. (You should probably add constructors for what you actually need,
  150. but I do consider adding a `ruamel.yaml.unsafe` package that will re-add the `typ='unsafe'` option.
  151. *Please adjust/pin your dependencies accordingly if necessary.*
  152. -------
  153. Version 0.18.16 was the last one tested to be working with Python 3.8.
  154. Version 0.18.9 was the last one tested to be working with Python 3.7.
  155. Version 0.17.21 was the last one tested to be working on Python 3.5 and 3.6.
  156. The 0.16.13 release was the last that was tested to be working on Python 2.7.
  157. There are two extra plug-in packages
  158. (`ruamel.yaml.bytes` and `ruamel.yaml.string`)
  159. for those not wanting to do the streaming to a
  160. `io.BytesIO/StringIO` buffer themselves.
  161. If your package uses `ruamel.yaml` and is not listed on PyPI, drop me an
  162. email, preferably with some information on how you use the package (or a
  163. link to the repository) and I'll keep you informed when the status of
  164. the API is stable enough to make the transition.
  165. For packaging purposes you can use a download of the [tar balls of tagged source](https://yaml.dev/ruamel-dl-tagged-releases)
  166. <a href="https://bestpractices.coreinfrastructure.org/projects/1128"><img src="https://bestpractices.coreinfrastructure.org/projects/1128/badge"></a>
  167. <a href="https://opensource.org/licenses/MIT"><img src="https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/_doc/_static/license.svg?format=raw"></a>
  168. <a href="https://pypi.org/project/ruamel.yaml/"><img src="https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/_doc/_static/pypi.svg?format=raw"></a>
  169. <a href="https://pypi.org/project/oitnb/"><img src="https://sourceforge.net/p/oitnb/code/ci/default/tree/_doc/_static/oitnb.svg?format=raw"></a>
  170. <a href="http://mypy-lang.org/"><img src="http://www.mypy-lang.org/static/mypy_badge.svg"></a>
  171. <a href="https://www.pepy.tech/projects/ruamel.yaml"><img src="https://img.shields.io/pepy/dt/ruamel.yaml.svg"></a>
  172. 0.19.0 (2025-01-02):
  173. - removed dependency on `ruamel.yaml.clibz`
  174. 0.19.0 (2025-12-31):
  175. - changed dependency on `ruamel.yaml.clib` to `ruamel.yaml.clibz` which includes support for free-threading (revisited after a bug report by [Ahmed Moustafa](https://sourceforge.net/u/aemous/profile/) and some insistance by [Nathan Goldbaum](https://sourceforge.net/u/ngoldbaum/profile/)
  176. - added `.max_depth` to `YAML()` instance. If set to a (positive) number this limits the recursion, so loading does throw a `MaxDepthExceededError`. Based on comments by Benjamin Oberdorfer via email. This also triggered the new documenation section on processing unchecked input.
  177. 0.18.17 (2025-12-17):
  178. - try to load C functions from `_ruamel_yaml_clibz` first.
  179. 0.18.16 (2025-10-22):
  180. - root level block style scalars that started with a directives-end marker or a document-end marker, are now indented 2 spaces.
  181. - merged fix for accessing end_marks on Tokens provided by [Toknak](https://sourceforge.net/u/taknok/)
  182. 0.18.15 (2025-08-19):
  183. - duplicate merge keys are never allowed (not even with .allow_duplicate_keys = True
  184. - merge keys now keep there position if a key before the merge key gets deleted (previously a key after the merge key would move before it)
  185. 0.18.14 (2025-06-09):
  186. - Fix issue with constructing dataclasses that have a default factoryi attribute, but were missing a mapping value for that attribute. Reported by [Victor Prieto](https://sourceforge.net/u/vsprieto/profile/)
  187. - the tagged release tar files can now also be downloaded from https://yaml.dev/ruamel-dl-tagged-releases/ please adjust if you use https://sourceforge.net/projects/ruamel-dl-tagged-releases/files/ as that repository in sourceforge will no longer be updated from some later date.
  188. 0.18.13 (2025-06-06):
  189. - Fix line wrapping on plain scalars not observing width correctly. Issue 529, reported by [Sebastien Vermeille](https://sourceforge.net/u/svermeille/profile/)
  190. - Fix sha256 and length in RECORD files. Reported by [Evan](https://sourceforge.net/u/bempelise/profile/)
  191. 0.18.12 (2025-05-30):
  192. - fix additional issue with extra space in double quoted string. Reported by [Saugat Pachhai](https://sourceforge.net/u/skshetry/profile/)
  193. - fix duplicate key url, now pointing to yaml.dev. Reported by [Hugo](https://sourceforge.net/u/hugovk/profile/)
  194. - fix broken RECORD file, which was a problem for uv, not pip. Reported by [konstin](https://sourceforge.net/u/konstin/profile/)
  195. 0.18.11 (2025-05-19):
  196. - function `load_yaml_guess_indent` now takes an option `yaml` argument so you can provide an already created/configured `YAML` instance
  197. - Sequence item indicator with both comment/empty line before indicator **and** comment before sequence item, could not move comment and raise `NotImplementedError`. Reported by [Karsten Tessarzik](https://sourceforge.net/u/kars10/profile/).
  198. - missing f for f-string (reported by π, via email)
  199. - fixed issue with extra space in double quoted dump (reported by [Jan Möller](https://sourceforge.net/u/redfiredragon/profile/))
  200. 0.18.10 (2025-01-06):
  201. - implemented changes to the setup.py for Python 3.14 as suggested by [Miro Hrončok](https://sourceforge.net/u/hroncok/profile/) in merge requests (MR not merged as those files are copied in from `develop` config)
  202. 0.18.9 (2025-01-05):
  203. - fix issue with roundtripping 0 in YAML 1.1 reported by [Peter Law](https://sourceforge.net/u/peterjclaw/profile/)
  204. 0.18.8 (2025-01-02):
  205. - added warning to README.md that PyPI might block updates due to breaking changes
  206. 0.18.7 (2024-12-30):
  207. - fixes for README (reported by [Kees Bakker](https://sourceforge.net/u/keesb/profile/))
  208. - fixes preserving anchor on scalar integer `0` (issue reported by (Mor Peled)[https://sourceforge.net/u/morp/profile/] and also in a question by [Ravi](https://stackoverflow.com/users/6550398/ravi) on [Stackoverflow](https://stackoverflow.com/a/79306830/1307905))
  209. - fix for formatting of README suggested by [Michael R. Crusoe](https://sourceforge.net/u/crusoe/profile/)
  210. 0.18.6 (2024-02-07):
  211. - fixed an issue with dataclass loading when the fields were collections (bug found as a result of a question by [FibroMyAlgebra](https://stackoverflow.com/users/6855070/fibromyalgebra) on [StackOverflow](https://stackoverflow.com/a/77485786/1307905))
  212. - fixed an issue loading dataclasses with `InitVar` fields when `from __future__ import annotations` was used to delay evaluation of typing.
  213. 0.18.5 (2023-11-03):
  214. - there is some indication that dependent packages have been pinned to use specific (tested) and just install the latest even in Python versions that have end-of-life
  215. 0.18.4 (2023-11-01):
  216. - YAML() instance has a `doc_infos` attribute which is a cumulative list of DocInfo instances (one for `load()`, one per document for `load_all()`). DocInfo instances contain version information (requested, directive) and tag directive information
  217. - fix issue that the YAML instance tags attribute was not reset between documents, resulting in mixing of tag directives of multiple documents. Now only provides tag directive information on latest document after loading. This means tags for dumping must be set **again** after a document is loaded with the same instance. (because of this tags will be removed in a favour of a different mechanism in the future)
  218. - fix issue with multiple document intermixing YAML 1.2 and YAML 1.1, the VersionedResolver now resets
  219. - fix issue with disappearing comment when next token was Tag (still can't have both a comment before a tag and after a tag, before node)
  220. 0.18.3 (2023-10-29):
  221. - fix issue with spurious newline on first item after comment + nested block sequence
  222. - additional links in the metadata on PyPI (Reported, with pointers how to fix, by [Sorin](https://sourceforge.net/u/ssbarnea/profile/)).
  223. 0.18.2 (2023-10-24):
  224. - calling the deprecated functions now raises an `AttributeError` with the, somewhat more informative, orginal warning message. Instead of calling `sys.exit(1)`
  225. 0.18.1 (2023-10-24):
  226. - calling the deprecated functions now always displays the warning message. (reported by [Trend Lloyd](https://sourceforge.net/u/lathiat2/profile/))
  227. 0.18.0 (2023-10-23):
  228. - the **functions** `scan`, `parse`, `compose`, `load`, `emit`, `serialize`, `dump` and their variants (`_all`, `safe_`, `round_trip_`, etc) have been deprecated (the same named **methods** on `YAML()` instances are, of course, still there.
  229. - `YAML(typ='unsafe')` now issues a `PendingDeprecationWarning`. This will become deprecated in the 0.18 series
  230. (probably before the end of 2023).
  231. You can use `YAML(typ='full')` to dump unregistered Python classes/functions.
  232. For loading you'll have to register your classes/functions
  233. if you want the old, unsafe, functionality. You can still load any tag, like `!!python/name:posix.system', **safely**
  234. with the (default) round-trip parser.
  235. - fix for `bytes-like object is required not 'str' while dumping binary streams`. This was reported, analysed and a fix provided by [Vit Zikmund](https://sourceforge.net/u/tlwhitec/profile/)
  236. ------------------------------------------------------------------------
  237. For older changes see the file
  238. [CHANGES](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/CHANGES)