Hello community, here is the log from the commit of package python-yq for openSUSE:Factory checked in at 2020-07-21 15:50:47 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-yq (Old) and /work/SRC/openSUSE:Factory/.python-yq.new.3592 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-yq" Tue Jul 21 15:50:47 2020 rev:7 rq:822066 version:2.10.1 Changes: -------- --- /work/SRC/openSUSE:Factory/python-yq/python-yq.changes 2020-03-05 23:22:34.541320600 +0100 +++ /work/SRC/openSUSE:Factory/.python-yq.new.3592/python-yq.changes 2020-07-21 15:53:45.988542527 +0200 @@ -1,0 +2,9 @@ +Tue Jul 21 10:35:58 UTC 2020 - Marketa Calabkova <[email protected]> + +- Update to 2.10.1 + * Add support for xmltodict force_list definition for xq CLI (#95) + * Support explicit doc markers (#93) + * Ensure proper ordering of help messages (#90) +- Drop already merged pyaml53.patch + +------------------------------------------------------------------- Old: ---- pyaml53.patch yq-2.10.0.tar.gz New: ---- yq-2.10.1.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-yq.spec ++++++ --- /var/tmp/diff_new_pack.UaV43y/_old 2020-07-21 15:53:53.688551890 +0200 +++ /var/tmp/diff_new_pack.UaV43y/_new 2020-07-21 15:53:53.692551895 +0200 @@ -18,13 +18,12 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-yq -Version: 2.10.0 +Version: 2.10.1 Release: 0 Summary: Command-line YAML processor - jq wrapper for YAML documents License: Apache-2.0 URL: https://github.com/kislyuk/yq Source: https://files.pythonhosted.org/packages/source/y/yq/yq-%{version}.tar.gz -Patch0: pyaml53.patch BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -51,7 +50,6 @@ %prep %setup -q -n yq-%{version} -%patch0 -p1 %build %python_build ++++++ yq-2.10.0.tar.gz -> yq-2.10.1.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yq-2.10.0/PKG-INFO new/yq-2.10.1/PKG-INFO --- old/yq-2.10.0/PKG-INFO 2019-12-23 17:52:29.000000000 +0100 +++ new/yq-2.10.1/PKG-INFO 2020-05-11 17:22:50.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: yq -Version: 2.10.0 +Version: 2.10.1 Summary: Command-line YAML/XML processor - jq wrapper for YAML/XML documents Home-page: https://github.com/kislyuk/yq Author: Andrey Kislyuk @@ -53,7 +53,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ``-Y`` option helps preserve custom `string styles <https://yaml-multiline.info/>`_ and - `tags <https://camel.readthedocs.io/en/latest/yamlref.html#tags>`_ in your document. For exmaple, consider the following + `tags <https://camel.readthedocs.io/en/latest/yamlref.html#tags>`_ in your document. For example, consider the following document (an `AWS CloudFormation <https://aws.amazon.com/cloudformation/>`_ template fragment):: Resources: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yq-2.10.0/README.rst new/yq-2.10.1/README.rst --- old/yq-2.10.0/README.rst 2019-12-23 17:43:58.000000000 +0100 +++ new/yq-2.10.1/README.rst 2020-05-03 18:22:01.000000000 +0200 @@ -45,7 +45,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ``-Y`` option helps preserve custom `string styles <https://yaml-multiline.info/>`_ and -`tags <https://camel.readthedocs.io/en/latest/yamlref.html#tags>`_ in your document. For exmaple, consider the following +`tags <https://camel.readthedocs.io/en/latest/yamlref.html#tags>`_ in your document. For example, consider the following document (an `AWS CloudFormation <https://aws.amazon.com/cloudformation/>`_ template fragment):: Resources: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yq-2.10.0/setup.py new/yq-2.10.1/setup.py --- old/yq-2.10.0/setup.py 2019-12-23 17:47:08.000000000 +0100 +++ new/yq-2.10.1/setup.py 2020-05-11 17:22:15.000000000 +0200 @@ -6,7 +6,7 @@ setup( name="yq", - version="2.10.0", + version="2.10.1", url="https://github.com/kislyuk/yq", license="Apache Software License", author="Andrey Kislyuk", diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yq-2.10.0/test/doc.yml new/yq-2.10.1/test/doc.yml --- old/yq-2.10.0/test/doc.yml 1970-01-01 01:00:00.000000000 +0100 +++ new/yq-2.10.1/test/doc.yml 2020-05-03 18:24:12.000000000 +0200 @@ -0,0 +1,18 @@ +--- +yaml_struct: + - key_1: '$.*?/|\^(){}+@[]&_-' + key_2: + - '$.*?/|\^(){}+@[]&_-' + - "{\_}" + - value23 + key_3: value31 + key_4: + - value41 + - value42 + key_5: value51 + - key_1_: value12 + _key_2: + - value24 + - value25 + _key__3: '$.*?/|\^(){}+@[]&_-' +... diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yq-2.10.0/test/test.py new/yq-2.10.1/test/test.py --- old/yq-2.10.0/test/test.py 2019-12-23 17:38:41.000000000 +0100 +++ new/yq-2.10.1/test/test.py 2020-05-11 17:02:43.000000000 +0200 @@ -3,7 +3,7 @@ from __future__ import absolute_import, division, print_function, unicode_literals -import os, sys, unittest, tempfile, json, io, platform, subprocess +import os, sys, unittest, tempfile, json, io, platform, subprocess, yaml sys.path.insert(0, os.path.abspath(os.path.join(os.path.dirname(__file__), '..'))) from yq import yq, cli # noqa @@ -116,7 +116,10 @@ def test_datetimes(self): self.assertEqual(self.run_yq("- 2016-12-20T22:07:36Z\n", ["."]), "") - self.assertEqual(self.run_yq("- 2016-12-20T22:07:36Z\n", ["-y", "."]), "- '2016-12-20T22:07:36'\n") + if yaml.__version__ < '5.3': + self.assertEqual(self.run_yq("- 2016-12-20T22:07:36Z\n", ["-y", "."]), "- '2016-12-20T22:07:36'\n") + else: + self.assertEqual(self.run_yq("- 2016-12-20T22:07:36Z\n", ["-y", "."]), "- '2016-12-20T22:07:36+00:00'\n") self.assertEqual(self.run_yq("2016-12-20", ["."]), "") self.assertEqual(self.run_yq("2016-12-20", ["-y", "."]), "'2016-12-20'\n") @@ -154,6 +157,12 @@ self.assertEqual(tf.read(), b'foo\n...\n') self.assertEqual(tf2.read(), b'foo\n...\n') + def test_explicit_doc_markers(self): + test_doc = os.path.join(os.path.dirname(__file__), "doc.yml") + self.assertTrue(self.run_yq("", ["-y", ".", test_doc]).startswith("yaml_struct")) + self.assertTrue(self.run_yq("", ["-y", "--explicit-start", ".", test_doc]).startswith("---")) + self.assertTrue(self.run_yq("", ["-y", "--explicit-end", ".", test_doc]).endswith("...\n")) + @unittest.expectedFailure def test_times(self): """ @@ -166,6 +175,12 @@ self.assertEqual(self.run_yq("<foo/>", ["."], input_format="xml"), "") self.assertEqual(self.run_yq("<foo/>", ["-x", ".foo.x=1"], input_format="xml"), '<foo>\n <x>1</x>\n</foo>\n') + + self.assertEqual(self.run_yq("<a><b/></a>", ["-y", "."], input_format="xml"), + "a:\n b: null\n") + self.assertEqual(self.run_yq("<a><b/></a>", ["-y", "--xml-force-list", "b", "."], input_format="xml"), + "a:\n b:\n - null\n") + with tempfile.TemporaryFile() as tf, tempfile.TemporaryFile() as tf2: tf.write(b'<a><b/></a>') tf.seek(0) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yq-2.10.0/yq/__init__.py new/yq-2.10.1/yq/__init__.py --- old/yq-2.10.0/yq/__init__.py 2019-12-23 17:39:16.000000000 +0100 +++ new/yq-2.10.1/yq/__init__.py 2020-05-11 16:57:44.000000000 +0200 @@ -130,8 +130,8 @@ yq(**yq_args) def yq(input_streams=None, output_stream=None, input_format="yaml", output_format="json", - program_name="yq", width=None, indentless_lists=False, xml_root=None, xml_dtd=False, - jq_args=frozenset(), exit_func=None): + program_name="yq", width=None, indentless_lists=False, xml_root=None, xml_dtd=False, xml_force_list=frozenset(), + explicit_start=False, explicit_end=False, jq_args=frozenset(), exit_func=None): if not input_streams: input_streams = [sys.stdin] if not output_stream: @@ -163,7 +163,8 @@ input_docs.extend(yaml.load_all(input_stream, Loader=loader)) elif input_format == "xml": import xmltodict - input_docs.append(xmltodict.parse(input_stream.read(), disable_entities=True)) + input_docs.append(xmltodict.parse(input_stream.read(), disable_entities=True, + force_list=xml_force_list)) elif input_format == "toml": import toml input_docs.append(toml.load(input_stream)) @@ -175,7 +176,8 @@ if output_format == "yaml" or output_format == "annotated_yaml": yaml.dump_all(decode_docs(jq_out, json_decoder), stream=output_stream, Dumper=get_dumper(use_annotations=use_annotations, indentless=indentless_lists), - width=width, allow_unicode=True, default_flow_style=False) + width=width, allow_unicode=True, default_flow_style=False, + explicit_start=explicit_start, explicit_end=explicit_end) elif output_format == "xml": import xmltodict for doc in decode_docs(jq_out, json_decoder): @@ -219,7 +221,8 @@ elif input_format == "xml": import xmltodict for input_stream in input_streams: - json.dump(xmltodict.parse(input_stream.read(), disable_entities=True), jq.stdin) + json.dump(xmltodict.parse(input_stream.read(), disable_entities=True, + force_list=xml_force_list), jq.stdin) jq.stdin.write("\n") elif input_format == "toml": import toml diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yq-2.10.0/yq/parser.py new/yq-2.10.1/yq/parser.py --- old/yq-2.10.0/yq/parser.py 2019-12-23 05:06:54.000000000 +0100 +++ new/yq-2.10.1/yq/parser.py 2020-05-11 17:03:10.000000000 +0200 @@ -12,6 +12,7 @@ def print_help(self): yq_help = argparse.ArgumentParser.format_help(self).splitlines() print("\n".join(["usage: yq [options] <jq filter> [YAML file...]"] + yq_help[1:] + [""])) + sys.stdout.flush() try: subprocess.check_call(["jq", "--help"]) except Exception: @@ -21,24 +22,27 @@ # By default suppress these help strings and only enable them in the specific programs. yaml_output_help, yaml_roundtrip_help, width_help, indentless_help = (argparse.SUPPRESS, argparse.SUPPRESS, argparse.SUPPRESS, argparse.SUPPRESS) - xml_output_help, xml_dtd_help, xml_root_help = argparse.SUPPRESS, argparse.SUPPRESS, argparse.SUPPRESS + xml_output_help, xml_dtd_help, xml_root_help, xml_force_list_help = (argparse.SUPPRESS, argparse.SUPPRESS, + argparse.SUPPRESS, argparse.SUPPRESS) toml_output_help = argparse.SUPPRESS if program_name == "yq": current_language = "YAML" yaml_output_help = "Transcode jq JSON output back into YAML and emit it" - yaml_roundtrip_help = """Transcode jq JSON output back into YAML and emit it. -Preserve YAML tags and styles by representing them as extra items -in their enclosing mappings and sequences while in JSON. This option -is incompatible with jq filters that do not expect these extra items.""" + yaml_roundtrip_help = ("Transcode jq JSON output back into YAML and emit it. " + "Preserve YAML tags and styles by representing them as extra items " + "in their enclosing mappings and sequences while in JSON. This option " + "is incompatible with jq filters that do not expect these extra items.") width_help = "When using --yaml-output, specify string wrap width" - indentless_help = """When using --yaml-output, indent block style lists (sequences) -with 0 spaces instead of 2""" + indentless_help = ("When using --yaml-output, indent block style lists (sequences) " + "with 0 spaces instead of 2") elif program_name == "xq": current_language = "XML" xml_output_help = "Transcode jq JSON output back into XML and emit it" xml_dtd_help = "Preserve XML Document Type Definition (disables streaming of multiple docs)" xml_root_help = "When transcoding back to XML, envelope the output in an element with this name" + xml_force_list_help = ("Tag name to pass to force_list parameter of xmltodict.parse(). " + "Can be used multiple times.") elif program_name == "tq": current_language = "TOML" toml_output_help = "Transcode jq JSON output back into TOML and emit it" @@ -57,10 +61,13 @@ const="annotated_yaml", help=yaml_roundtrip_help) parser.add_argument("--width", "-w", type=int, help=width_help) parser.add_argument("--indentless-lists", "--indentless", action="store_true", help=indentless_help) + parser.add_argument("--explicit-start", action="store_true", help=argparse.SUPPRESS) + parser.add_argument("--explicit-end", action="store_true", help=argparse.SUPPRESS) parser.add_argument("--xml-output", "-x", dest="output_format", action="store_const", const="xml", help=xml_output_help) parser.add_argument("--xml-dtd", action="store_true", help=xml_dtd_help) parser.add_argument("--xml-root", help=xml_root_help) + parser.add_argument("--xml-force-list", action="append", help=xml_force_list_help) parser.add_argument("--toml-output", "-t", dest="output_format", action="store_const", const="toml", help=toml_output_help) parser.add_argument("--in-place", "-i", action="store_true", help="Edit files in place (no backup - use caution)") diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yq-2.10.0/yq/version.py new/yq-2.10.1/yq/version.py --- old/yq-2.10.0/yq/version.py 2019-12-23 17:52:24.000000000 +0100 +++ new/yq-2.10.1/yq/version.py 2020-05-11 17:22:44.000000000 +0200 @@ -1 +1 @@ -__version__ = '2.10.0' +__version__ = '2.10.1' diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yq-2.10.0/yq.egg-info/PKG-INFO new/yq-2.10.1/yq.egg-info/PKG-INFO --- old/yq-2.10.0/yq.egg-info/PKG-INFO 2019-12-23 17:52:28.000000000 +0100 +++ new/yq-2.10.1/yq.egg-info/PKG-INFO 2020-05-11 17:22:50.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: yq -Version: 2.10.0 +Version: 2.10.1 Summary: Command-line YAML/XML processor - jq wrapper for YAML/XML documents Home-page: https://github.com/kislyuk/yq Author: Andrey Kislyuk @@ -53,7 +53,7 @@ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ The ``-Y`` option helps preserve custom `string styles <https://yaml-multiline.info/>`_ and - `tags <https://camel.readthedocs.io/en/latest/yamlref.html#tags>`_ in your document. For exmaple, consider the following + `tags <https://camel.readthedocs.io/en/latest/yamlref.html#tags>`_ in your document. For example, consider the following document (an `AWS CloudFormation <https://aws.amazon.com/cloudformation/>`_ template fragment):: Resources: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/yq-2.10.0/yq.egg-info/SOURCES.txt new/yq-2.10.1/yq.egg-info/SOURCES.txt --- old/yq-2.10.0/yq.egg-info/SOURCES.txt 2019-12-23 17:52:28.000000000 +0100 +++ new/yq-2.10.1/yq.egg-info/SOURCES.txt 2020-05-11 17:22:50.000000000 +0200 @@ -5,6 +5,7 @@ setup.py test/bomb.yml test/cfn.yml +test/doc.yml test/test.py yq/__init__.py yq/compat.py
