diff options
author | V3n3RiX <venerix@koprulu.sector> | 2023-04-11 23:39:55 +0100 |
---|---|---|
committer | V3n3RiX <venerix@koprulu.sector> | 2023-04-11 23:39:55 +0100 |
commit | 7d040c2d1b0c38c8635ec28dfaa632a2db8be895 (patch) | |
tree | 78e9474cad949bcd1254749d61f4f6b9e7d488bf /app-misc/yq | |
parent | 0d39cf7bd8aae36b5d8eb4272a42dc6919216e34 (diff) |
gentoo auto-resync : 11:04:2023 - 23:39:54
Diffstat (limited to 'app-misc/yq')
-rw-r--r-- | app-misc/yq/Manifest | 1 | ||||
-rw-r--r-- | app-misc/yq/files/yq-3.1.0-tomli.patch | 94 |
2 files changed, 0 insertions, 95 deletions
diff --git a/app-misc/yq/Manifest b/app-misc/yq/Manifest index 419c5c841b42..62cc3a647780 100644 --- a/app-misc/yq/Manifest +++ b/app-misc/yq/Manifest @@ -1,5 +1,4 @@ AUX yq-2.13.0-tests.patch 746 BLAKE2B 0d769a32a3e80cdc8a49e0f3575ab9da880bb0a916a564261874e6a8775b35c5570e99fad5a902bdf9bbdf5a6bb080a7bf57324aad461fb1ca7d9de4da787808 SHA512 e6bd60877d628e2fac51d5395b03f96a0cf7a5033c72a676dee8fe353425f6cc7ee585404567778d7765459ded0f7f71b6563e2343de9d520b8cde493012af01 -AUX yq-3.1.0-tomli.patch 4426 BLAKE2B ae6b056a2d7c1a5c0603a5fa8c49face53c1b04ab46ef58c6960c8356c16e4f5a085b980031df5623ee6598c964b75b87700f79ace37a2b14760be3133994a5c SHA512 c6c73f03710db12e3b52ebd2d1f8d36e5cb610b57af73b86d15440823dd2b8be8ad13cc3337476efb2972122a626e65857cd67c964586664bc452bd6b98e968a AUX yq-3.1.1-tomli.patch 3537 BLAKE2B 672b7cb6d9418197bd0163fef51f0e141e59bcd9d7529cbe0aee3c10c13196116fdfcbd1c964ba8deae2cb357d0a634a4061d85dc14bec7cb28c6031e15da9f3 SHA512 bc98a46e112145e44d5c480cd22d9ebd7369a6f0208126242acc188ef1574c60ca446b237b26fdde4130e7fedf3a5c73a4f24498c56dc788dc5cee0fe22b4d0f DIST yq-3.1.1.tar.gz 30095 BLAKE2B 0f8ed3d23e1c1b65fae0164f34b19ab774308ee8ec9b5c21547c5eddf930c49750cdbee858b6b48bcd92d4146715f7e4c45dd976141dc5837c788e4ae68a51bc SHA512 f6d372fd406179121849330391ab5657e9bac3b6fb4d33673872d4649337fd60344fe01c534d1382cc35416919cd19b62287350d1f0f825f198fb9cc9bc58c1f DIST yq-3.2.1.tar.gz 30333 BLAKE2B ead106995dcd03bc729aabd07c20dff37cf42053378f9d73c20739cb10921619999df73852d69f397431c4a382d40735c751aff9676d66ab9edbc5480a5c6807 SHA512 5b696434c9b6520873f4b956370fe598e3ac8df544d8b4ebc0d7fa935d344e58d9b838f2133b02c9e35a8afc5193c309d36b4cd8dc7792aef17918b9704b58e0 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") |