public inbox for gentoo-commits@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-commits] repo/gentoo:master commit in: app-misc/yq/files/
@ 2022-02-22 18:49 Zac Medico
  0 siblings, 0 replies; 3+ messages in thread
From: Zac Medico @ 2022-02-22 18:49 UTC (permalink / raw
  To: gentoo-commits

commit:     f1b0fb34d4a3e26bfa6ff5bec706bedbb35cf525
Author:     Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Tue Feb 22 16:03:52 2022 +0000
Commit:     Zac Medico <zmedico <AT> gentoo <DOT> org>
CommitDate: Tue Feb 22 18:47:32 2022 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=f1b0fb34

app-misc/yq: remove unused patch

Closes: https://github.com/gentoo/gentoo/pull/24318
Package-Manager: Portage-3.0.30, Repoman-3.0.3
Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Signed-off-by: Zac Medico <zmedico <AT> gentoo.org>

 app-misc/yq/files/yq-2.11.1-tests.patch | 13 -------------
 1 file changed, 13 deletions(-)

diff --git a/app-misc/yq/files/yq-2.11.1-tests.patch b/app-misc/yq/files/yq-2.11.1-tests.patch
deleted file mode 100644
index 6b6231ad7eed..000000000000
--- a/app-misc/yq/files/yq-2.11.1-tests.patch
+++ /dev/null
@@ -1,13 +0,0 @@
-diff --git a/test/test.py b/test/test.py
-index a81f41b..f17f03c 100755
---- a/test/test.py
-+++ b/test/test.py
-@@ -84,7 +84,7 @@ class TestYq(unittest.TestCase):
-         unusable_tty_input = mock.Mock()
-         unusable_tty_input.isatty = mock.Mock(return_value=True)
- 
--        self.run_yq("{}", [], expect_exit_codes={0} if sys.stdin.isatty() else {2})
-+        self.run_yq("{}", [], expect_exit_codes={0})
-         self.run_yq("{}", ["."])
-         self.run_yq(unusable_non_tty_input, [".", test_doc])
-         self.run_yq(unusable_non_tty_input, [".", test_doc, test_doc])


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-misc/yq/files/
@ 2023-04-11 20:32 Patrick McLean
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick McLean @ 2023-04-11 20:32 UTC (permalink / raw
  To: gentoo-commits

commit:     c598ffb17a27c854ed164e2ba3cfbcdeb5f2559a
Author:     Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Tue Apr 11 18:10:40 2023 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Tue Apr 11 20:32:42 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=c598ffb1

app-misc/yq: remove unused patch

Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Closes: https://github.com/gentoo/gentoo/pull/30557
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 app-misc/yq/files/yq-3.1.0-tomli.patch | 94 ----------------------------------
 1 file changed, 94 deletions(-)

diff --git a/app-misc/yq/files/yq-3.1.0-tomli.patch b/app-misc/yq/files/yq-3.1.0-tomli.patch
deleted file mode 100644
index ad6d8a1d7e7d..000000000000
--- a/app-misc/yq/files/yq-3.1.0-tomli.patch
+++ /dev/null
@@ -1,94 +0,0 @@
-From 425ebfb12908c0d5f72f5a4eec06a235e8bbd54b Mon Sep 17 00:00:00 2001
-From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= <mgorny@gentoo.org>
-Date: Sun, 23 Oct 2022 11:38:58 +0200
-Subject: [PATCH] Use tomllib/tomli/tomli-w instead of unmaintained toml
- package
-
-Replace the use of the unmaintained `toml` package with the modern
-trinity: built-in `tomllib` module for reading TOML in Python 3.11+,
-`tomli` for reading TOML in older Python versions and `tomli-w` for
-writing TOML in all Python versions.  This ensures correct TOML 1.0
-support that the old `toml` package lacks.
----
- README.rst     |  4 +++-
- setup.py       |  3 ++-
- yq/__init__.py | 18 ++++++++++++------
- 3 files changed, 17 insertions(+), 8 deletions(-)
-
-diff --git a/README.rst b/README.rst
-index 69d77e1..237b89e 100644
---- a/README.rst
-+++ b/README.rst
-@@ -109,7 +109,9 @@ the ``xq --xml-output``/``xq -x`` option. Multiple XML documents can be passed i
- TOML support
- ------------
- ``yq`` supports `TOML <https://toml.io/>`_ as well. The ``yq`` package installs an executable, ``tomlq``, which uses the
--`toml library <https://github.com/uiri/toml>`_ to transcode TOML to JSON, then pipes it to ``jq``. Roundtrip transcoding
-+`tomllib module <https://docs.python.org/3.11/library/tomllib.html>` or `tomli library
-+<https://github.com/hukkin/tomli>`_ to transcode TOML to JSON, then pipes it to ``jq``. Transcoding to TOML uses the
-+`tomli-w <https://github.com/hukkin/toml-w`_ package. Roundtrip transcoding
- is available with the ``tomlq --toml-output``/``tomlq -t`` option.
- 
- .. admonition:: Compatibility note
-diff --git a/setup.py b/setup.py
-index 9a7f643..71774ed 100755
---- a/setup.py
-+++ b/setup.py
-@@ -19,7 +19,8 @@
-     install_requires=[
-         "PyYAML >= 5.3.1",
-         "xmltodict >= 0.11.0",
--        "toml >= 0.10.0",
-+        "tomli >= 1.2.3; python_version < '3.11'",
-+        "tomli-w",
-         "argcomplete >= 1.8.1"
-     ],
-     extras_require={
-diff --git a/yq/__init__.py b/yq/__init__.py
-index 1043ff7..dd89408 100755
---- a/yq/__init__.py
-+++ b/yq/__init__.py
-@@ -201,8 +201,11 @@ def yq(input_streams=None, output_stream=None, input_format="yaml", output_forma
-                     json.dump(doc, json_buffer, cls=JSONDateTimeEncoder)
-                     json_buffer.write("\n")
-                 elif input_format == "toml":
--                    import toml
--                    doc = toml.load(input_stream)
-+                    if sys.version_info >= (3, 11):
-+                        import tomllib
-+                    else:
-+                        import tomli as tomllib
-+                    doc = tomllib.loads(input_stream.read())
-                     json.dump(doc, json_buffer, cls=JSONDateTimeEncoder)
-                     json_buffer.write("\n")
-                 else:
-@@ -235,12 +238,12 @@ def yq(input_streams=None, output_stream=None, input_format="yaml", output_forma
-                             raise
-                     output_stream.write(b"\n" if sys.version_info < (3, 0) else "\n")
-             elif output_format == "toml":
--                import toml
-+                import tomli_w
-                 for doc in decode_docs(jq_out, json_decoder):
-                     if not isinstance(doc, dict):
-                         msg = "{}: Error converting JSON to TOML: cannot represent non-object types at top level."
-                         exit_func(msg.format(program_name))
--                    toml.dump(doc, output_stream)
-+                    output_stream.write(tomli_w.dumps(doc))
-         else:
-             if input_format == "yaml":
-                 loader_class = get_loader(use_annotations=False, expand_aliases=expand_aliases,
-@@ -255,9 +258,12 @@ def yq(input_streams=None, output_stream=None, input_format="yaml", output_forma
-                                               force_list=xml_force_list), jq.stdin)
-                     jq.stdin.write("\n")
-             elif input_format == "toml":
--                import toml
-+                if sys.version_info >= (3, 11):
-+                    import tomllib
-+                else:
-+                    import tomli as tomllib
-                 for input_stream in input_streams:
--                    json.dump(toml.load(input_stream), jq.stdin)
-+                    json.dump(tomllib.loads(input_stream.read()), jq.stdin)
-                     jq.stdin.write("\n")
-             else:
-                 raise Exception("Unknown input format")


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [gentoo-commits] repo/gentoo:master commit in: app-misc/yq/files/
@ 2023-09-13 16:39 Patrick McLean
  0 siblings, 0 replies; 3+ messages in thread
From: Patrick McLean @ 2023-09-13 16:39 UTC (permalink / raw
  To: gentoo-commits

commit:     33c8cbf635f82a0789e5baa1d89e1f95da26a4bc
Author:     Michael Mair-Keimberger <mmk <AT> levelnine <DOT> at>
AuthorDate: Wed Sep 13 12:18:39 2023 +0000
Commit:     Patrick McLean <chutzpah <AT> gentoo <DOT> org>
CommitDate: Wed Sep 13 16:38:40 2023 +0000
URL:        https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=33c8cbf6

app-misc/yq: remove unused patch

Signed-off-by: Michael Mair-Keimberger <mmk <AT> levelnine.at>
Closes: https://github.com/gentoo/gentoo/pull/32751
Signed-off-by: Patrick McLean <chutzpah <AT> gentoo.org>

 app-misc/yq/files/yq-3.1.1-tomli.patch | 80 ----------------------------------
 1 file changed, 80 deletions(-)

diff --git a/app-misc/yq/files/yq-3.1.1-tomli.patch b/app-misc/yq/files/yq-3.1.1-tomli.patch
deleted file mode 100644
index b4ef5ef3dfb9..000000000000
--- a/app-misc/yq/files/yq-3.1.1-tomli.patch
+++ /dev/null
@@ -1,80 +0,0 @@
-diff --git a/README.rst b/README.rst
-index 69d77e1..237b89e 100644
---- a/README.rst
-+++ b/README.rst
-@@ -109,7 +109,9 @@ the ``xq --xml-output``/``xq -x`` option. Multiple XML documents can be passed i
- TOML support
- ------------
- ``yq`` supports `TOML <https://toml.io/>`_ as well. The ``yq`` package installs an executable, ``tomlq``, which uses the
--`toml library <https://github.com/uiri/toml>`_ to transcode TOML to JSON, then pipes it to ``jq``. Roundtrip transcoding
-+`tomllib module <https://docs.python.org/3.11/library/tomllib.html>` or `tomli library
-+<https://github.com/hukkin/tomli>`_ to transcode TOML to JSON, then pipes it to ``jq``. Transcoding to TOML uses the
-+`tomli-w <https://github.com/hukkin/toml-w`_ package. Roundtrip transcoding
- is available with the ``tomlq --toml-output``/``tomlq -t`` option.
- 
- .. admonition:: Compatibility note
-diff --git a/setup.py b/setup.py
-index 9de217e..7d34f8c 100755
---- a/setup.py
-+++ b/setup.py
-@@ -19,7 +19,8 @@ setup(
-     install_requires=[
-         "PyYAML >= 5.3.1",
-         "xmltodict >= 0.11.0",
--        "toml >= 0.10.0",
-+        "tomli >= 1.2.3; python_version < '3.11'",
-+        "tomli-w",
-         "argcomplete >= 1.8.1",
-     ],
-     extras_require={
-diff --git a/yq/__init__.py b/yq/__init__.py
-index 0ccb8e8..88da1d7 100644
---- a/yq/__init__.py
-+++ b/yq/__init__.py
-@@ -246,9 +246,12 @@ def yq(
-                     json.dump(doc, json_buffer, cls=JSONDateTimeEncoder)
-                     json_buffer.write("\n")
-                 elif input_format == "toml":
--                    import toml
-+                    if sys.version_info >= (3, 11):
-+                        import tomllib
-+                    else:
-+                        import tomli as tomllib
- 
--                    doc = toml.load(input_stream)  # type: ignore
-+                    doc = tomllib.loads(input_stream.read())  # type: ignore
-                     json.dump(doc, json_buffer, cls=JSONDateTimeEncoder)
-                     json_buffer.write("\n")
-                 else:
-@@ -295,13 +298,13 @@ def yq(
-                             raise
-                     output_stream.write(b"\n" if sys.version_info < (3, 0) else "\n")
-             elif output_format == "toml":
--                import toml
-+                import tomli_w
- 
-                 for doc in decode_docs(jq_out, json_decoder):
-                     if not isinstance(doc, dict):
-                         msg = "{}: Error converting JSON to TOML: cannot represent non-object types at top level."
-                         exit_func(msg.format(program_name))
--                    toml.dump(doc, output_stream)
-+                    output_stream.write(tomli_w.dumps(doc))
-         else:
-             if input_format == "yaml":
-                 loader_class = get_loader(
-@@ -327,10 +330,13 @@ def yq(
-                     )
-                     jq.stdin.write("\n")  # type: ignore
-             elif input_format == "toml":
--                import toml
-+                if sys.version_info >= (3, 11):
-+                    import tomllib
-+                else:
-+                    import tomli as tomllib
- 
-                 for input_stream in input_streams:
--                    json.dump(toml.load(input_stream), jq.stdin, cls=JSONDateTimeEncoder)  # type: ignore
-+                    json.dump(tomllib.loads(input_stream.read()), jq.stdin, cls=JSONDateTimeEncoder)  # type: ignore
-                     jq.stdin.write("\n")  # type: ignore
-             else:
-                 raise Exception("Unknown input format")


^ permalink raw reply related	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2023-09-13 16:39 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-09-13 16:39 [gentoo-commits] repo/gentoo:master commit in: app-misc/yq/files/ Patrick McLean
  -- strict thread matches above, loose matches on Subject: below --
2023-04-11 20:32 Patrick McLean
2022-02-22 18:49 Zac Medico

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox