diff --git a/pyaml53.patch b/pyaml53.patch new file mode 100644 index 0000000..020fc88 --- /dev/null +++ b/pyaml53.patch @@ -0,0 +1,35 @@ +From 5754ef46981d688dd249f96fc55ceaf4cd51f130 Mon Sep 17 00:00:00 2001 +From: "Daniel M. Capella" +Date: Sat, 29 Feb 2020 16:10:50 -0500 +Subject: [PATCH] Fix test_datetimes for PyYAML >=5.3 + +https://github.com/yaml/pyyaml/pull/163 +--- + test/test.py | 7 +++++-- + 1 file changed, 5 insertions(+), 2 deletions(-) + +diff --git a/test/test.py b/test/test.py +index 12fa806..8897196 100755 +--- a/test/test.py ++++ b/test/test.py +@@ -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_multidocs(self): + + 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") diff --git a/python-yq.changes b/python-yq.changes index 3ba66d6..8077261 100644 --- a/python-yq.changes +++ b/python-yq.changes @@ -1,3 +1,14 @@ +------------------------------------------------------------------- +Thu Mar 5 08:32:23 UTC 2020 - Tomáš Chvátal + +- Update to 2.10.0: + * Add support for in-place editing (yq -yi) + * Add argcomplete integration + * Docs: Migrate from RTD to gh-pages + * Add -Y/--yaml-roundtrip for preserving YAML styles and tags +- Add patch to work with new PyYAML: + * pyaml53.patch + ------------------------------------------------------------------- Wed Oct 30 12:17:49 UTC 2019 - Tomáš Chvátal diff --git a/python-yq.spec b/python-yq.spec index 1663318..ad3bb47 100644 --- a/python-yq.spec +++ b/python-yq.spec @@ -1,7 +1,7 @@ # # spec file for package python-yq # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,17 +18,19 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} Name: python-yq -Version: 2.8.1 +Version: 2.10.0 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 Requires: jq Requires: python-PyYAML >= 3.11 +Requires: python-argcomplete >= 1.8.1 Requires: python-setuptools Requires: python-toml >= 0.9.4 Requires: python-xmltodict >= 0.11.0 @@ -37,6 +39,7 @@ Requires(postun): update-alternatives BuildArch: noarch # SECTION test requirements BuildRequires: %{python_module PyYAML >= 3.11} +BuildRequires: %{python_module argcomplete >= 1.8.1} BuildRequires: %{python_module toml >= 0.9.4} BuildRequires: %{python_module xmltodict >= 0.11.0} BuildRequires: jq @@ -48,6 +51,7 @@ yq: Command-line YAML processor - jq wrapper for YAML documents %prep %setup -q -n yq-%{version} +%patch0 -p1 %build %python_build diff --git a/yq-2.10.0.tar.gz b/yq-2.10.0.tar.gz new file mode 100644 index 0000000..39285e5 --- /dev/null +++ b/yq-2.10.0.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:abaf2c0728f1c38dee852e976b0a6def5ab660d67430ee5af76b7a37072eba46 +size 19970 diff --git a/yq-2.8.1.tar.gz b/yq-2.8.1.tar.gz deleted file mode 100644 index ae8c22b..0000000 --- a/yq-2.8.1.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:24d36c7e9e670209562a161b8506ff7e86959be49ba7aee4ca659810801e5710 -size 14737