Skip to content

Commit

Permalink
Merge pull request #22 from faucetsdn/ruamel.yaml-0.18.10
Browse files Browse the repository at this point in the history
Import ruamel.yaml 0.18.10 source
  • Loading branch information
gizmoguy authored Jan 9, 2025
2 parents c758661 + 567b5cc commit 3fbccbf
Show file tree
Hide file tree
Showing 23 changed files with 401 additions and 357 deletions.
4 changes: 4 additions & 0 deletions .hgtags
Original file line number Diff line number Diff line change
Expand Up @@ -232,3 +232,7 @@ a35908655d678b8463ee6198869a0708b3446e06 0.18.2
e32fbfcda1a48d808542670d91f1e84d14f69956 0.18.3
08d87cada1f6e5fedde079b55536061e4fe246a0 0.18.4
eb3ecf31085135283908fc8449befebbc1fff4b3 0.18.5
6f41eb6001661917fceb0e88ed0693ae1a7c50f4 0.18.6
2ccda40f4274005ca52b7976e2d9666a66f9e5f9 0.18.7
6d77c3b64d97a2c94729fa48e3236657a0352a47 0.18.8
68accd7d13b00de1917a8e1604f1fbf76d3b7bfe 0.18.9
17 changes: 17 additions & 0 deletions CHANGES
Original file line number Diff line number Diff line change
@@ -1,3 +1,20 @@
[0.18.10, 2025-01-06]:
- 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)

[0.18.9, 2025-01-05]:
- fix issue with roundtripping 0 in YAML 1.1 reported by [Peter Law](https://sourceforge.net/u/peterjclaw/profile/)

[0.18.8, 2025-01-02]:
- added warning to README.md that PyPI might block updates due to breaking changes

[0.18.7, 2024-12-30]:
- fixes for README (reported by [Kees Bakker](https://sourceforge.net/u/keesb/profile/))
- 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))
- fix for formatting of README suggested by [Michael R. Crusoe](https://sourceforge.net/u/crusoe/profile/)

[0.18.6, 2024-02-07]:
- 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)
Expand Down
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2014-2024 Anthon van der Neut, Ruamel bvba
Copyright (c) 2014-2025 Anthon van der Neut, Ruamel bvba

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
142 changes: 58 additions & 84 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,45 @@

# ruamel.yaml

`ruamel.yaml` is a YAML 1.2 loader/dumper package for Python.
<table class="docutils">
<tr> <td>version</td>
<td>0.18.6</td>
</tr>
<tr> <td>updated</td>
<td>2024-02-07</td>
</tr>
<tr> <td>documentation</td>
<td><a href="https://yaml.readthedocs.io">https://yaml.readthedocs.io</a></td>
</tr>
<tr> <td>repository</td>
<td><a href="https://sourceforge.net/projects/ruamel-yaml">https://sourceforge.net/projects/ruamel-yaml</a></td>
</tr>
<tr> <td>pypi</td>
<td><a href="https://pypi.org/project/ruamel.yaml">https://pypi.org/project/ruamel.yaml</a></td>
</tr>
</table>

| | |
| - | - |
| version |0.18.9 |
| updated |2025-01-05 |
| documentation |https://yaml.dev/doc/ruamel.yaml |
| repository |https://sourceforge.net/projects/ruamel-yaml |
| pypi |https://pypi.org/project/ruamel.yaml |


## breaking changes, that may make future uploads to PyPI impossible

*If you are interested in future upgrades of `ruamel.yaml`
please check the [documentation on installing](https://yaml.dev/doc/ruamel.yaml/install/),
since at some point I might not be able to upload a new version to PyPI with updated information.*

`ruamel.yaml` was intentionally named as `yaml` in a namespace `ruamel`. The namespace allows the installation
name to correspond unchanged to how the package is imported, reduces the number of links I have to create
in site-packages of a Python install during development, as well as providing a recognisable set of packages
my company releases to the public.

However, after uploading version 0.18.7, I got an email from PyPI, about having to change the project name
to `ruamel_yaml` to comply with PEP 625, sometime in the future. The email doesn't say if namespace packages are
no longer allowed, or how to deal with the very real clash with the pre-existing package `ruamel_yaml`.

I might not be able to adapt `ruamel.yaml`, in
a way that does not negatively affect the 0.5 million daily downloads (and my own usage of the package) in time.
My experience with other such service downgrades (Bitbucket, Readthedocs), has not been entirely positive.

-----



As announced, in 0.18.0, the old PyYAML functions have been deprecated.
(`scan`, `parse`, `compose`, `load`, `emit`, `serialize`, `dump` and their variants
(`_all`, `safe_`, `round_trip_`, etc)). If you only read this after your program has
stopped working: I am sorry to hear that, but that also means you, or the person
developing your program, has not tested with warnings on (which is the recommendation
in PEP 565, and e.g. defaultin when using `pytest`). If you have troubles, explicitly use
in PEP 565, and e.g. defaulting when using `pytest`). If you have troubles, explicitly use
```
pip install "ruamel.yaml<0.18.0"
```
Expand All @@ -44,15 +57,16 @@ but I do consider adding a `ruamel.yaml.unsafe` package that will re-add the `ty

There seems to be a CVE on `ruamel.yaml`, stating that the `load()` function could be abused
because of unchecked input. `load()` was never the default function (that was `round_trip_load()`
before the new API came into existence`. So the creator of that CVE was ill informed and
before the new API came into existence. So the creator of that CVE was ill informed and
probably lazily assumed that since `ruamel.yaml` is a derivative of PyYAML (for which
a similar CVE exists), the same problem would still exist, without checking.
So the CVE was always inappriate, now just more so, as the call
So the CVE was always inappropriate, now just more so, as the call
to the function `load()` with any input will terminate your program with an error message. If you
(have to) care about such things as this CVE, my recommendation is to stop using Python
completely, as `pickle.load()` can be abused in the same way as `load()` (and like unlike `load()`
is only documented to be unsafe, without development-time warning.

Version 0.18.9 was the last one tested to be working with Python 3.7
Version 0.17.21 was the last one tested to be working on Python 3.5 and 3.6<BR>
The 0.16.13 release was the last that was tested to be working on Python 2.7.

Expand All @@ -67,69 +81,29 @@ email, preferably with some information on how you use the package (or a
link to the repository) and I'll keep you informed when the status of
the API is stable enough to make the transition.

<pre>
<a href="overview/#overview">Overview</a>

<a href="install/#installing">Installing</a>
<a href="install/#optional-requirements">Optional requirements</a>

<a href="basicuse/#basic-usage">Basic Usage</a>
<a href="basicuse/#load-and-dump">Load and dump </a>
<a href="basicuse/#more-examples">More examples</a>

<a href="dumpcls/#working-with-python-classes">Working with Python classes</a>
<a href="dumpcls/#dumping-python-classes">Dumping Python classes</a>
<a href="dumpcls/#dataclass">Dataclass</a>

<a href="detail/#details">Details</a>
<a href="detail/#indentation-of-block-sequences">Indentation of block sequences</a>
<a href="detail/#inconsistently-indented-yaml">Inconsistently indented YAML</a>
<a href="detail/#indenting-using-typsafe">Indenting using `typ="safe"`</a>
<a href="detail/#positioning-in-top-level-mappings-prefixing">Positioning ':' in top level mappings, prefixing ':'</a>
<a href="detail/#document-version-support">Document version support</a>
<a href="detail/#round-trip-including-comments">Round trip including comments</a>
<a href="detail/#config-file-formats">Config file formats</a>
<a href="detail/#extending">Extending</a>
<a href="detail/#smartening">Smartening</a>

<a href="example/#examples">Examples</a>
<a href="example/#output-of-dump-as-a-string">Output of `dump()` as a string</a>

<a href="api/#departure-from-previous-api">Departure from previous API</a>
<a href="api/#loading">Loading</a>
<a href="api/#duplicate-keys">Duplicate keys</a>
<a href="api/#dumping-a-multi-document-yaml-stream">Dumping a multi-document YAML stream</a>
<a href="api/#dumping">Dumping</a>
<a href="api/#controls">Controls</a>
<a href="api/#transparent-usage-of-new-and-old-api">Transparent usage of new and old API</a>
<a href="api/#reason-for-api-change">Reason for API change</a>

<a href="pyyaml/#differences-with-pyyaml">Differences with PyYAML</a>
<a href="pyyaml/#defaulting-to-yaml-12-support">Defaulting to YAML 1.2 support</a>
<a href="pyyaml/#py2py3-reintegration">PY2/PY3 reintegration</a>
<a href="pyyaml/#fixes">Fixes</a>
<a href="pyyaml/#testing">Testing</a>
<a href="pyyaml/#api">API</a>

<a href="contributing/#contributing">Contributing</a>
<a href="contributing/#documentation">Documentation</a>
<a href="contributing/#code">Code</a>
<a href="contributing/#flake">Flake</a>
<a href="contributing/#toxpytest">Tox/pytest</a>
<a href="contributing/#typingmypy">Typing/mypy</a>
<a href="contributing/#generated-files">Generated files</a>
<a href="contributing/#vulnerabilities">Vulnerabilities</a>
</pre>



[![image](https://readthedocs.org/projects/yaml/badge/?version=latest)](https://yaml.readthedocs.org/en/latest?badge=latest)[![image](https://bestpractices.coreinfrastructure.org/projects/1128/badge)](https://bestpractices.coreinfrastructure.org/projects/1128)
[![image](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/_doc/_static/license.svg?format=raw)](https://opensource.org/licenses/MIT)
[![image](https://sourceforge.net/p/ruamel-yaml/code/ci/default/tree/_doc/_static/pypi.svg?format=raw)](https://pypi.org/project/ruamel.yaml/)
[![image](https://sourceforge.net/p/oitnb/code/ci/default/tree/_doc/_static/oitnb.svg?format=raw)](https://pypi.org/project/oitnb/)
[![image](http://www.mypy-lang.org/static/mypy_badge.svg)](http://mypy-lang.org/)

# ChangeLog

<a href="https://bestpractices.coreinfrastructure.org/projects/1128"><img src="https://bestpractices.coreinfrastructure.org/projects/1128/badge"></a>
<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>
<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>
<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>
<a href="http://mypy-lang.org/"><img src="http://www.mypy-lang.org/static/mypy_badge.svg"></a>
<a href="https://www.pepy.tech/projects/ruamel.yaml"><img src="https://img.shields.io/pepy/dt/ruamel.yaml.svg"></a>
NEXT:<br>
- 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)

0.18.9 (2025-01-05):

- fix issue with roundtripping 0 in YAML 1.1 reported by [Peter Law](https://sourceforge.net/u/peterjclaw/profile/)

0.18.8 (2025-01-02):

- added warning to README.md that PyPI might block updates due to breaking changes

0.18.7 (2024-12-30):

- fixes for README (reported by [Kees Bakker](https://sourceforge.net/u/keesb/profile/))
- 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))
- fix for formatting of README suggested by [Michael R. Crusoe](https://sourceforge.net/u/crusoe/profile/)

0.18.6 (2024-02-07):

Expand Down
17 changes: 5 additions & 12 deletions __init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

_package_data = dict(
full_package_name='ruamel.yaml',
version_info=(0, 18, 6),
__version__='0.18.6',
version_timestamp='2024-02-07 07:43:33',
version_info=(0, 18, 10),
__version__='0.18.10',
version_timestamp='2025-01-06 15:02:34',
author='Anthon van der Neut',
author_email='[email protected]',
description='ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order', # NOQA
Expand All @@ -20,21 +20,14 @@
'docs': ['ryd', 'mercurial>5.7'],
},
classifiers=[
'Programming Language :: Python :: 3 :: Only',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9',
'Programming Language :: Python :: 3.10',
'Programming Language :: Python :: 3.11',
'Programming Language :: Python :: 3.12',
'Programming Language :: Python :: Implementation :: CPython',
'Topic :: Software Development :: Libraries :: Python Modules',
'Topic :: Text Processing :: Markup',
'Typing :: Typed',
],
keywords='yaml 1.2 parser round-trip preserve quotes order config',
read_the_docs='yaml',
supported=[(3, 7)], # minimum
url_doc='https://yaml.dev/doc/{full_package_name}',
supported=[(3, 8)], # minimum
tox=dict(
env='*',
fl8excl='_test/lib,branch_default',
Expand Down
Loading

0 comments on commit 3fbccbf

Please sign in to comment.