From ab7810b87f5bb33b3ed5edd0dbda7f4bcd0cf70d Mon Sep 17 00:00:00 2001 From: V3n3RiX Date: Wed, 13 Sep 2023 22:45:20 +0100 Subject: gentoo auto-resync : 13:09:2023 - 22:45:20 --- app-misc/yq/files/yq-3.1.1-tomli.patch | 80 ---------------------------------- 1 file changed, 80 deletions(-) delete mode 100644 app-misc/yq/files/yq-3.1.1-tomli.patch (limited to 'app-misc/yq/files/yq-3.1.1-tomli.patch') 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 `_ as well. The ``yq`` package installs an executable, ``tomlq``, which uses the --`toml library `_ to transcode TOML to JSON, then pipes it to ``jq``. Roundtrip transcoding -+`tomllib module ` or `tomli library -+`_ to transcode TOML to JSON, then pipes it to ``jq``. Transcoding to TOML uses the -+`tomli-w = 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") -- cgit v1.2.3