summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Mair-Keimberger <mmk@levelnine.at>2023-09-13 14:18:39 +0200
committerPatrick McLean <chutzpah@gentoo.org>2023-09-13 09:38:40 -0700
commit33c8cbf635f82a0789e5baa1d89e1f95da26a4bc (patch)
treef3ca7a71638d1fdce693978e797b431595677a56
parentsys-kernel/gentoo-sources: drop 6.1.52 (diff)
downloadgentoo-33c8cbf635f82a0789e5baa1d89e1f95da26a4bc.tar.gz
gentoo-33c8cbf635f82a0789e5baa1d89e1f95da26a4bc.tar.bz2
gentoo-33c8cbf635f82a0789e5baa1d89e1f95da26a4bc.zip
app-misc/yq: remove unused patch
Signed-off-by: Michael Mair-Keimberger <mmk@levelnine.at> Closes: https://github.com/gentoo/gentoo/pull/32751 Signed-off-by: Patrick McLean <chutzpah@gentoo.org>
-rw-r--r--app-misc/yq/files/yq-3.1.1-tomli.patch80
1 files changed, 0 insertions, 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")