summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnthon van der Neut <anthon@mnt.org>2018-09-07 10:20:34 +0200
committerAnthon van der Neut <anthon@mnt.org>2018-09-07 10:20:34 +0200
commita2afbcfe5398c971ed59d583eb88588c789bfa67 (patch)
tree4fe61f32162f29e82294ac82e0fd3a3693683783
parent56383ab8491ed86f6a2133aeff2dd03dad4e829a (diff)
downloadruamel.yaml-a2afbcfe5398c971ed59d583eb88588c789bfa67.tar.gz
roll out new version, with some fixes/enhancements0.15.65
-rw-r--r--CHANGES8
-rw-r--r--README.rst9
-rw-r--r--__init__.py72
-rw-r--r--_doc/_static/pypi.svg2
-rw-r--r--_test/test_issues.py7
-rw-r--r--_test/test_spec_examples.py2
-rw-r--r--scanner.py2
7 files changed, 57 insertions, 45 deletions
diff --git a/CHANGES b/CHANGES
index ca5b22e..ff446b4 100644
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,11 @@
+[0, 15, 65]: 2018-09-07
+ - fix issue #232 revert to throw ParserError for unexcpected ``]``
+ and ``}`` instead of IndexError. (Issue reported and PR with fix
+ provided by `Naomi Seyfer <https://bitbucket.org/sixolet/>`__.)
+ - added ``key`` and ``reverse`` parameter (suggested by Jannik Klemm via email)
+ - indent root level literal scalars that have directive or document end markers
+ at the beginning of a line
+
[0, 15, 64]: 2018-08-30
- support round-trip of tagged sequences: ``!Arg [a, {b: 1}]``
- single entry mappings in flow sequences now written by default without quotes
diff --git a/README.rst b/README.rst
index 943df7c..2f2466a 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.64
-:updated: 2018-08-30
+:version: 0.15.65
+:updated: 2018-09-07
:documentation: http://yaml.readthedocs.io
:repository: https://bitbucket.org/ruamel/
:pypi: https://pypi.org/project/ruamel.yaml/
@@ -54,7 +54,10 @@ ChangeLog
.. should insert NEXT: at the beginning of line for next key (with empty line)
-NEXT:
+0.15.65 (2018-09-07):
+ - fix issue #232 revert to throw ParserError for unexcpected ``]``
+ and ``}`` instead of IndexError. (Issue reported and PR with fix
+ provided by `Naomi Seyfer <https://bitbucket.org/sixolet/>`__.)
- added ``key`` and ``reverse`` parameter (suggested by Jannik Klemm via email)
- indent root level literal scalars that have directive or document end markers
at the beginning of a line
diff --git a/__init__.py b/__init__.py
index 1638ae5..c0c17c9 100644
--- a/__init__.py
+++ b/__init__.py
@@ -7,60 +7,60 @@ if False: # MYPY
_package_data = dict(
full_package_name='ruamel.yaml',
- version_info=(0, 15, 64),
- __version__='0.15.64',
+ version_info=(0, 15, 65),
+ __version__='0.15.65',
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
entry_points=None,
since=2014,
- extras_require={
- ':platform_python_implementation=="CPython" and python_version<="2.7"': [
- 'ruamel.ordereddict'
- ],
- 'jinja2': ['ruamel.yaml.jinja2>=0.2'],
- 'docs': ['ryd'],
- },
+ extras_require={':platform_python_implementation=="CPython" and python_version<="2.7"': [
+ 'ruamel.ordereddict',
+ ], 'jinja2': ['ruamel.yaml.jinja2>=0.2'], 'docs': ['ryd']},
ext_modules=[
- dict(
- name='_ruamel_yaml',
- src=[
- 'ext/_ruamel_yaml.c',
- 'ext/api.c',
- 'ext/writer.c',
- 'ext/dumper.c',
- 'ext/loader.c',
- 'ext/reader.c',
- 'ext/scanner.c',
- 'ext/parser.c',
- 'ext/emitter.c',
- ],
- lib=[],
- test="""
+ dict(
+ name='_ruamel_yaml',
+ src=[
+ 'ext/_ruamel_yaml.c',
+ 'ext/api.c',
+ 'ext/writer.c',
+ 'ext/dumper.c',
+ 'ext/loader.c',
+ 'ext/reader.c',
+ 'ext/scanner.c',
+ 'ext/parser.c',
+ 'ext/emitter.c',
+ ],
+ lib=[],
+ test="""
int main(int argc, char* argv[])
{
/* prevent warning */
return 0;
}
""",
- )
+ ),
],
# NOQA
# test='#include "ext/yaml.h"\n\nint main(int argc, char* argv[])\n{\nyaml_parser_t parser;\nparser = parser; /* prevent warning */\nreturn 0;\n}\n', # NOQA
classifiers=[
- 'Programming Language :: Python :: 2.7',
- 'Programming Language :: Python :: 3.4',
- 'Programming Language :: Python :: 3.5',
- 'Programming Language :: Python :: 3.6',
- 'Programming Language :: Python :: 3.7',
- 'Programming Language :: Python :: Implementation :: CPython',
- 'Programming Language :: Python :: Implementation :: PyPy',
- 'Programming Language :: Python :: Implementation :: Jython',
- 'Topic :: Software Development :: Libraries :: Python Modules',
- 'Topic :: Text Processing :: Markup',
+ 'Programming Language :: Python :: 2.7',
+ 'Programming Language :: Python :: 3.4',
+ 'Programming Language :: Python :: 3.5',
+ 'Programming Language :: Python :: 3.6',
+ 'Programming Language :: Python :: 3.7',
+ 'Programming Language :: Python :: Implementation :: CPython',
+ 'Programming Language :: Python :: Implementation :: PyPy',
+ 'Programming Language :: Python :: Implementation :: Jython',
+ 'Topic :: Software Development :: Libraries :: Python Modules',
+ 'Topic :: Text Processing :: Markup',
],
keywords='yaml 1.2 parser round-trip preserve quotes order config',
- wheels=dict(windows='appveyor', linux='libyaml-devel', macos='builder@macos'),
+ wheels=dict(
+ windows='appveyor',
+ linux='libyaml-devel',
+ macos='builder@macos',
+ ),
read_the_docs='yaml',
supported=[(2, 7), (3, 4)], # minimum
tox=dict(
diff --git a/_doc/_static/pypi.svg b/_doc/_static/pypi.svg
index 04d56a6..f88c2bb 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.64</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.64</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.65</text><text x="585" y="140" transform="scale(.1)" textLength="430">0.15.65</text></g> </svg>
diff --git a/_test/test_issues.py b/_test/test_issues.py
index d6eadc6..07097c8 100644
--- a/_test/test_issues.py
+++ b/_test/test_issues.py
@@ -134,7 +134,7 @@ class TestIssues:
x = round_trip(s, preserve_quotes=True) # NOQA
json_str = (
- '{"sshKeys":[{"name":"AETROS\/google-k80-1","uses":0,"getLastUse":0,'
+ r'{"sshKeys":[{"name":"AETROS\/google-k80-1","uses":0,"getLastUse":0,'
'"fingerprint":"MD5:19:dd:41:93:a1:a3:f5:91:4a:8e:9b:d0:ae:ce:66:4c",'
'"created":1509497961}]}'
)
@@ -384,7 +384,8 @@ class TestIssues:
def test_issue_232(self):
import ruamel.yaml
from ruamel import yaml
+
with pytest.raises(ruamel.yaml.parser.ParserError):
- yaml.safe_load(']')
+ yaml.safe_load(']')
with pytest.raises(ruamel.yaml.parser.ParserError):
- yaml.safe_load('{]')
+ yaml.safe_load('{]')
diff --git a/_test/test_spec_examples.py b/_test/test_spec_examples.py
index c95b5aa..bae505d 100644
--- a/_test/test_spec_examples.py
+++ b/_test/test_spec_examples.py
@@ -182,7 +182,7 @@ def test_example_2_12():
@pytest.mark.xfail(strict=True)
def test_example_2_13():
yaml = YAML()
- yaml.round_trip("""
+ yaml.round_trip(r"""
# ASCII Art
--- |
\//||\/||
diff --git a/scanner.py b/scanner.py
index e4a8765..bbd77d2 100644
--- a/scanner.py
+++ b/scanner.py
@@ -533,7 +533,7 @@ class Scanner(object):
self.remove_possible_simple_key()
# Decrease the flow level.
try:
- popped = self.flow_context.pop()
+ popped = self.flow_context.pop() # NOQA
except IndexError:
# We must not be in a list or object.
# Defer error handling to the parser.