Team Ai
Datasetpublic

codekingpro/portable-devtools

sourceHugging Faceupdated 5mo agoView on Hugging Face
1likes14kdownloads
1Metadata-Version: 2.42Name: ruamel.yaml3Version: 0.19.14Summary: ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order5Author: Anthon van der Neut6Author-email: a.van.der.neut@ruamel.eu7License: MIT8Project-URL: Home, https://sourceforge.net/p/ruamel-yaml/9Project-URL: Source, https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/10Project-URL: Tracker, https://sourceforge.net/p/ruamel-yaml/tickets/11Project-URL: Documentation, https://yaml.dev/doc/ruamel.yaml12Keywords: yaml 1.2 parser round-trip preserve quotes order config13Classifier: Development Status :: 4 - Beta14Classifier: Intended Audience :: Developers15Classifier: License :: OSI Approved :: MIT License16Classifier: Operating System :: OS Independent17Classifier: Programming Language :: Python18Classifier: Programming Language :: Python :: 3.919Classifier: Programming Language :: Python :: 3.1020Classifier: Programming Language :: Python :: 3.1121Classifier: Programming Language :: Python :: 3.1222Classifier: Programming Language :: Python :: 3.1323Classifier: Programming Language :: Python :: 3.1424Classifier: Programming Language :: Python :: Implementation :: CPython25Classifier: Topic :: Software Development :: Libraries :: Python Modules26Classifier: Topic :: Text Processing :: Markup27Classifier: Typing :: Typed28Requires-Python: >=3.929Description-Content-Type: text/markdown; charset=UTF-8; variant=CommonMark30License-File: LICENSE31Provides-Extra: oldlibyaml32Requires-Dist: ruamel.yaml.clib; platform_python_implementation == "CPython" and extra == "oldlibyaml"33Provides-Extra: libyaml34Requires-Dist: ruamel.yaml.clibz>=0.3.7; platform_python_implementation == "CPython" and extra == "libyaml"35Provides-Extra: jinja236Requires-Dist: ruamel.yaml.jinja2>=0.2; extra == "jinja2"37Provides-Extra: docs38Requires-Dist: ryd; extra == "docs"39Requires-Dist: mercurial>5.7; extra == "docs"40Dynamic: author41Dynamic: author-email42Dynamic: classifier43Dynamic: description44Dynamic: description-content-type45Dynamic: keywords46Dynamic: license47Dynamic: license-file48Dynamic: project-url49Dynamic: provides-extra50Dynamic: requires-python51Dynamic: summary52 53# ruamel.yaml54 55`ruamel.yaml` is a YAML 1.2 loader/dumper package for Python.56 57| | |58| - | - |59| version |0.19.0 |60| updated |2025-01-02 |61| documentation |https://yaml.dev/doc/ruamel.yaml |62| repository |https://sourceforge.net/projects/ruamel-yaml |63| pypi |https://pypi.org/project/ruamel.yaml |64 65 66## breaking changes, that may make future uploads to PyPI impossible67 68*If you are interested in future upgrades of `ruamel.yaml`69please check the [documentation on installing](https://yaml.dev/doc/ruamel.yaml/install/),70since at some point I might not be able to upload a new version to PyPI with updated information.*71 72`ruamel.yaml` was intentionally named as `yaml` in a namespace `ruamel`. The namespace allows the installation73name to correspond unchanged to how the package is imported, reduces the number of links I have to create74in site-packages of a Python install during development, as well as providing a recognisable set of packages75my company releases to the public. 76 77However, after uploading version 0.18.7, I got an email from PyPI, about having to change the project name78to `ruamel_yaml` to comply with PEP 625, sometime in the future. The email doesn't say if namespace packages are79no longer allowed, or how to deal with the very real clash with the pre-existing package `ruamel_yaml`.80 81I might not be able to adapt `ruamel.yaml`, in82a way that does not negatively affect the 0.5 million daily downloads (and my own usage of the package) in time. 83My experience with other such service downgrades (Bitbucket, Readthedocs), has not been entirely positive. 84 85-----86 87 88 89Starting with 0.19.1 `ruamel.yaml` no longer has a dependency on `ruamel.yaml.clibz`90nor on the old `ruamel.yaml.clib`.91 92Some deployment issues were reported on 0.19.0, due to the lack of proper pinning of the93`ruamel.yaml` version used. Most of these issues had to do with94the environment not having updated `setuptools` installed and the build95dependency `setuptools-zig` for `ruamel.yaml.clibz` not being invoked, with96Python falling back to invoking gcc (which was even less likely to be installed).97 98The already indicated simple solution of using:99 100```101    python -m pip install --no-deps ruamel.yaml ruamel.yaml.clib102 103```104turned out not to work for at least one setup.105 106As I am not aware that you can create an install requirement that removes107a dependency, the default (Cython) dependency is removed and you should108use `ruamel.yaml[libyaml]` resp. `ruamel.yaml[oldlibyaml]` as your requirements.109(this is the preferred way over using `ruamel.yaml.clibz` and `ruamel.yaml.clib`110directly).111If you are using `ruamel.yaml` in its default (round-trip, `YAML(typ='rt')`) mode,112there is currently no advantage of installing either optional extension.113 114 115The C sources are functionally unchanged,116but they are now always compiled (using `setuptools-zig` and `ziglang`) on your system,117instead of being downloaded as pre-compiled wheels (if available).118For this to function properly your Python (virtual) environment needs to have119an up-to-date version of `setuptools` and `wheels` pre-installed.120 121The code to load `ruamel.yaml.clib` has priority over `ruamel.yaml.clibz`122if both are installed.123This compatibility will at least be available during the 0.19 `ruamel.yaml` series124(so pin your usage of `ruamel.yaml` if necessary and report any problems).125 126The motivitation for this change is the availability,127and easy of use, of Zig as the toolchain128(in the form of `ziglang` on PyPi), so lenghty, non-optimized,129pre-compilation and uploading to PyPI,130is no longer necessary.131The time spent on creating ~60 wheels132and even more time wasted on dealing with CI providers (Appveyor133not being updated to support 3.14, Github CI being slow,134and charging for the use of your own computer,135etc).136 137The split out of `ruamel.yaml.clib` after the 0.15.100 release,138was also motivated by the time spent139on generating .whl files even if only Python code was changed.140The use of `ziglang` and `setuptools-zig` does make re-integration of the C sources141into `ruamel.yaml` feasable, but there are no plans yet to make this happen.142 143The test matrix for `ruamel.yaml.clibz`, of course still has many dimensions:144```145    Python versions: 3.9 - 3.14146    OS-es:           Linux, Alpine (musl), macOS, Windows147    Architectures:   Intel/AMD, Arm (and others), in 64 and some also in 32 bit versions148    Zig version:     ziglang < 0.16 is taken from PyPI149```150 151I try to test as much of the combinations as possible,152trying at least all supported Python versions,153including freethreading,154on macOS-arm64,155Linux arm64 (via docker containers),156Ubuntu Linux-Intel,157Linux musl intel (docker).158And at least one Python version along each of the indicated positions of the159dimensions above (e.g. Windows10 64bit was tested with Python 3.14, but I160could not test the RISC-V architecture).161As with generating .whl files previously162(which I could not all test myself)163I partly have to rely on the process of compilation/generation being likely correct,164and feedback from actual users,165of exotic (for me) platforms, is of course welcome.166 167There is new section,168in the documentation,169on the security of processing unchecked input.170 171-------172 173The potentially breaking change announced for the 0.18 series, in that `YAML(typ='unsafe')`174was going to be deprecated (now pending), has not yet  been implemented, but is still considered.175If you only use `unsafe` to dump, please use the new `YAML(typ='full')`, the result of that can be *safely*176loaded with a default  instance `YAML()`, as that will get you inspectable, tagged, scalars, instead of177executed Python functions/classes. (You should probably add constructors for what you actually need, 178but I do consider adding a `ruamel.yaml.unsafe` package that will re-add the `typ='unsafe'` option.179*Please adjust/pin your dependencies accordingly if necessary.*180 181-------182 183Version 0.18.16 was the last one tested to be working with Python 3.8.184Version 0.18.9 was the last one tested to be working with Python 3.7.185Version 0.17.21 was the last one tested to be working on Python 3.5 and 3.6.186The 0.16.13 release was the last that was tested to be working on Python 2.7.187 188 189There are two extra plug-in packages190(`ruamel.yaml.bytes` and `ruamel.yaml.string`)191for those not wanting to do the streaming to a192`io.BytesIO/StringIO` buffer themselves.193 194If your package uses `ruamel.yaml` and is not listed on PyPI, drop me an195email, preferably with some information on how you use the package (or a196link to the repository) and I'll keep you informed when the status of197the API is stable enough to make the transition.198 199For packaging purposes you can use a download of the [tar balls of tagged source](https://yaml.dev/ruamel-dl-tagged-releases)200 201 202<a href="https://bestpractices.coreinfrastructure.org/projects/1128"><img src="https://bestpractices.coreinfrastructure.org/projects/1128/badge"></a>203<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>204<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>205<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>206<a href="http://mypy-lang.org/"><img src="http://www.mypy-lang.org/static/mypy_badge.svg"></a>207<a href="https://www.pepy.tech/projects/ruamel.yaml"><img src="https://img.shields.io/pepy/dt/ruamel.yaml.svg"></a>208 2090.19.0 (2025-01-02):210 211- removed dependency on `ruamel.yaml.clibz`212 2130.19.0 (2025-12-31):214 215- 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/)216- 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.217 2180.18.17 (2025-12-17):219 220- try to load C functions from `_ruamel_yaml_clibz` first.221 2220.18.16 (2025-10-22):223 224- root level block style scalars that started with a directives-end marker or a document-end marker, are now indented 2 spaces.225- merged fix for accessing end_marks on Tokens provided by [Toknak](https://sourceforge.net/u/taknok/)226 2270.18.15 (2025-08-19):228 229- duplicate merge keys are never allowed (not even with .allow_duplicate_keys = True230- 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)231 2320.18.14 (2025-06-09):233 234- 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/)235- 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.236 2370.18.13 (2025-06-06):238 239- Fix line wrapping on plain scalars not observing width correctly. Issue 529, reported by [Sebastien Vermeille](https://sourceforge.net/u/svermeille/profile/)240- Fix sha256 and length in RECORD files. Reported by [Evan](https://sourceforge.net/u/bempelise/profile/)241 2420.18.12 (2025-05-30):243 244- fix additional issue with extra space in double quoted string. Reported by [Saugat Pachhai](https://sourceforge.net/u/skshetry/profile/)245- fix duplicate key url, now pointing to yaml.dev. Reported by [Hugo](https://sourceforge.net/u/hugovk/profile/)246- fix broken RECORD file, which was a problem for uv, not pip. Reported by [konstin](https://sourceforge.net/u/konstin/profile/)247 2480.18.11 (2025-05-19):249 250- function `load_yaml_guess_indent` now takes an option `yaml` argument so you can provide an already created/configured `YAML` instance251- 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/).252- missing f for f-string (reported by π, via email)253- fixed issue with extra space in double quoted dump (reported by [Jan Möller](https://sourceforge.net/u/redfiredragon/profile/))254 2550.18.10 (2025-01-06):256 257- 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)258 2590.18.9 (2025-01-05):260 261- fix issue with roundtripping 0 in YAML 1.1 reported by [Peter Law](https://sourceforge.net/u/peterjclaw/profile/)262 2630.18.8 (2025-01-02):264 265- added warning to README.md that PyPI might block updates due to breaking changes266 2670.18.7 (2024-12-30):268 269- fixes for README (reported by [Kees Bakker](https://sourceforge.net/u/keesb/profile/))270- 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))271- fix for formatting of README suggested by [Michael R. Crusoe](https://sourceforge.net/u/crusoe/profile/)272 2730.18.6 (2024-02-07):274 275- 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))276- fixed an issue loading dataclasses with `InitVar` fields when `from __future__ import annotations` was used to delay evaluation of typing.277 2780.18.5 (2023-11-03):279 280- 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-life281 2820.18.4 (2023-11-01):283 284- 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 information285- 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)286- fix issue with multiple document intermixing YAML 1.2 and YAML 1.1, the VersionedResolver now resets287- 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)288 2890.18.3 (2023-10-29):290 291- fix issue with spurious newline on first item after comment + nested block sequence292- additional links in the metadata on PyPI (Reported, with pointers how to fix, by [Sorin](https://sourceforge.net/u/ssbarnea/profile/)).293 2940.18.2 (2023-10-24):295 296- calling the deprecated functions now raises an `AttributeError` with the, somewhat more informative, orginal warning message. Instead of calling `sys.exit(1)`297 2980.18.1 (2023-10-24):299 300- calling the deprecated functions now always displays the warning message. (reported by [Trend Lloyd](https://sourceforge.net/u/lathiat2/profile/))301 3020.18.0 (2023-10-23):303 304- 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.305- `YAML(typ='unsafe')` now issues a `PendingDeprecationWarning`. This will become deprecated in the 0.18 series306(probably before the end of 2023).307You can use `YAML(typ='full')` to dump unregistered Python classes/functions. 308For loading you'll have to register your classes/functions309if you want the old, unsafe, functionality. You can still load any tag, like `!!python/name:posix.system', **safely** 310with the (default) round-trip parser.311- 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/)312 313 314------------------------------------------------------------------------315 316For older changes see the file317[CHANGES](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/CHANGES)318 
codekingpro/portable-devtools · Team Ai