summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--CHANGES8
-rw-r--r--README.rst17
-rw-r--r--__init__.py4
-rw-r--r--_doc/_static/pypi.svg2
-rw-r--r--_test/test_issues.py2
-rw-r--r--_test/test_z_olddata.py41
-rw-r--r--constructor.py12
7 files changed, 76 insertions, 10 deletions
diff --git a/CHANGES b/CHANGES
index 2b64da8..aaab1b7 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,11 @@
+[0, 15, 71]: 2018-09-26
+ - fix regression where handcrafted CommentedMaps could not be initiated (reported by
+ `Dan Helfman <https://bitbucket.org/dhelfman/>`__)
+ - fix regression with non-root literal scalars that needed indent indicator
+ (reported by `Clark Breyman <https://bitbucket.org/clarkbreyman/>`__)
+ - tag:yaml.org,2002:python/object/apply now also uses __qualname__ on PY3
+ (reported by `Douglas RAILLARD <https://bitbucket.org/DouglasRaillard/>`__)
+
[0, 15, 70]: 2018-09-21
- reverted CommentedMap and CommentedSeq to subclass ordereddict resp. list,
reimplemented merge maps so that both ``dict(**commented_map_instance)`` and JSON
diff --git a/README.rst b/README.rst
index 04f6783..5422764 100644
--- a/README.rst
+++ b/README.rst
@@ -4,8 +4,8 @@ ruamel.yaml
``ruamel.yaml`` is a YAML 1.2 loader/dumper package for Python.
-:version: 0.15.70
-:updated: 2018-09-21
+:version: 0.15.71
+:updated: 2018-09-26
:documentation: http://yaml.readthedocs.io
:repository: https://bitbucket.org/ruamel/
:pypi: https://pypi.org/project/ruamel.yaml/
@@ -54,6 +54,19 @@ ChangeLog
.. should insert NEXT: at the beginning of line for next key (with empty line)
+0.15.71 (2018-09-26):
+ - some of the tests now live in YAML files in the
+ `yaml.data <https://bitbucket.org/ruamel/yaml.data>`__ repository.
+ ``_test/test_z_data.py`` processes these.
+ - fix regression where handcrafted CommentedMaps could not be initiated (reported by
+ `Dan Helfman <https://bitbucket.org/dhelfman/>`__)
+ - fix regression with non-root literal scalars that needed indent indicator
+ (reported by `Clark Breyman <https://bitbucket.org/clarkbreyman/>`__)
+ - tag:yaml.org,2002:python/object/apply now also uses __qualname__ on PY3
+ (reported by `Douglas RAILLARD <https://bitbucket.org/DouglasRaillard/>`__)
+ - issue with self-referring object creation
+ (reported and fix by `Douglas RAILLARD <https://bitbucket.org/DouglasRaillard/>`__)
+
0.15.70 (2018-09-21):
- reverted CommentedMap and CommentedSeq to subclass ordereddict resp. list,
reimplemented merge maps so that both ``dict(**commented_map_instance)`` and JSON
diff --git a/__init__.py b/__init__.py
index 6ffb2d4..9b815db 100644
--- a/__init__.py
+++ b/__init__.py
@@ -7,8 +7,8 @@ if False: # MYPY
_package_data = dict(
full_package_name='ruamel.yaml',
- version_info=(0, 15, 70),
- __version__='0.15.70',
+ version_info=(0, 15, 71),
+ __version__='0.15.71',
author='Anthon van der Neut',
author_email='a.van.der.neut@ruamel.eu',
description='ruamel.yaml is a YAML parser/emitter that supports roundtrip preservation of comments, seq/map flow style, and map key order', # NOQA
diff --git a/_doc/_static/pypi.svg b/_doc/_static/pypi.svg
index 8b244c0..b5019c7 100644
--- a/_doc/_static/pypi.svg
+++ b/_doc/_static/pypi.svg
@@ -1 +1 @@
-<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="86" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="86" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h33v20H0z"/><path fill="#007ec6" d="M33 0h53v20H33z"/><path fill="url(#b)" d="M0 0h86v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="230">pypi</text><text x="175" y="140" transform="scale(.1)" textLength="230">pypi</text><text x="585" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">0.15.70</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.70</text></g> </svg>
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="86" height="20"><linearGradient id="b" x2="0" y2="100%"><stop offset="0" stop-color="#bbb" stop-opacity=".1"/><stop offset="1" stop-opacity=".1"/></linearGradient><clipPath id="a"><rect width="86" height="20" rx="3" fill="#fff"/></clipPath><g clip-path="url(#a)"><path fill="#555" d="M0 0h33v20H0z"/><path fill="#007ec6" d="M33 0h53v20H33z"/><path fill="url(#b)" d="M0 0h86v20H0z"/></g><g fill="#fff" text-anchor="middle" font-family="DejaVu Sans,Verdana,Geneva,sans-serif" font-size="110"> <text x="175" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="230">pypi</text><text x="175" y="140" transform="scale(.1)" textLength="230">pypi</text><text x="585" y="150" fill="#010101" fill-opacity=".3" transform="scale(.1)" textLength="430">0.15.71</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.71</text></g> </svg>
diff --git a/_test/test_issues.py b/_test/test_issues.py
index 5ee5125..fcf1094 100644
--- a/_test/test_issues.py
+++ b/_test/test_issues.py
@@ -510,9 +510,11 @@ class TestIssues:
def test_issue_242(self):
from ruamel.yaml.comments import CommentedMap
+
d0 = CommentedMap([('a', 'b')])
assert d0['a'] == 'b'
+
# @pytest.mark.xfail(strict=True, reason='bla bla', raises=AssertionError)
# def test_issue_xxx(self):
# inp = """
diff --git a/_test/test_z_olddata.py b/_test/test_z_olddata.py
new file mode 100644
index 0000000..91d89db
--- /dev/null
+++ b/_test/test_z_olddata.py
@@ -0,0 +1,41 @@
+# coding: utf-8
+
+from __future__ import print_function
+
+import sys
+import os
+import pytest # NOQA
+
+sys.path.insert(0, os.path.dirname(__file__) + '/lib')
+
+import warnings # NOQA
+
+
+args = []
+
+
+def test_data():
+ import test_appliance # NOQA
+
+ collections = []
+ import test_yaml
+
+ collections.append(test_yaml)
+ test_appliance.run(collections, args)
+
+
+# @pytest.mark.skipif(not ruamel.yaml.__with_libyaml__,
+# reason="no libyaml")
+
+
+def test_data_ext():
+ collections = []
+ import ruamel.yaml # NOQA
+ import test_appliance # NOQA
+
+ warnings.simplefilter('ignore', ruamel.yaml.error.UnsafeLoaderWarning)
+ if ruamel.yaml.__with_libyaml__:
+ import test_yaml_ext
+
+ collections.append(test_yaml_ext)
+ test_appliance.run(collections, args)
diff --git a/constructor.py b/constructor.py
index 6448067..245e9f7 100644
--- a/constructor.py
+++ b/constructor.py
@@ -133,9 +133,10 @@ class BaseConstructor(object):
old_deep = self.deep_construct
self.deep_construct = True
if node in self.recursive_objects:
- raise ConstructorError(
- None, None, 'found unconstructable recursive node', node.start_mark
- )
+ return self.recursive_objects[node]
+ # raise ConstructorError(
+ # None, None, 'found unconstructable recursive node', node.start_mark
+ # )
self.recursive_objects[node] = None
constructor = None # type: Any
tag_suffix = None
@@ -914,9 +915,10 @@ class Constructor(SafeConstructor):
# Format:
# !!python/object:module.name { ... state ... }
instance = self.make_python_instance(suffix, node, newobj=True)
+ self.recursive_objects[node] = instance
yield instance
- # deep = hasattr(instance, '__setstate__')
- state = self.construct_mapping(node, deep=False)
+ deep = hasattr(instance, '__setstate__')
+ state = self.construct_mapping(node, deep=deep)
self.set_python_instance_state(instance, state)
def construct_python_object_apply(self, suffix, node, newobj=False):