From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id B3252158087 for ; Tue, 1 Feb 2022 18:33:20 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 0B18A2BC042; Tue, 1 Feb 2022 18:33:20 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id DF0D72BC042 for ; Tue, 1 Feb 2022 18:33:19 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id E76553431D8 for ; Tue, 1 Feb 2022 18:33:18 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6218C166 for ; Tue, 1 Feb 2022 18:33:17 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1643584634.67e93e47d30280594c109b8153a83f0a19c027e5.mattst88@gentoo> Subject: [gentoo-commits] proj/catalyst:master commit in: catalyst/, doc/, catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py catalyst/main.py doc/make_subarch_table_guidexml.py X-VCS-Directories: catalyst/ catalyst/base/ doc/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: 67e93e47d30280594c109b8153a83f0a19c027e5 X-VCS-Branch: master Date: Tue, 1 Feb 2022 18:33:17 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: d920c33c-b2f9-4665-820b-99524bdcd58a X-Archives-Hash: 9f1df4ba395c38167e28369dc0c40bc5 commit: 67e93e47d30280594c109b8153a83f0a19c027e5 Author: Matt Turner gentoo org> AuthorDate: Sun Jan 30 20:22:43 2022 +0000 Commit: Matt Turner gentoo org> CommitDate: Sun Jan 30 23:17:14 2022 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=67e93e47 catalyst: Switch to tomli The Python community is coalescing around tomli, and tomli is likely to be integrated into the standard library per PEP680. Signed-off-by: Matt Turner gentoo.org> catalyst/base/stagebase.py | 6 +++--- catalyst/main.py | 5 +++-- doc/make_subarch_table_guidexml.py | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 4a1b4eb6..de1e30ef 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,7 +10,7 @@ from pathlib import Path import fasteners import libmount -import toml +import tomli from snakeoil import fileutils from snakeoil.osutils import pjoin @@ -123,8 +123,8 @@ class StageBase(TargetBase, ClearBase, GenBase): log.debug("\tTrying %s", x) name = x[:-len('.toml')] - with open(arch_dir + x) as file: - arch_config = toml.load(file) + with open(arch_dir + x, 'rb') as file: + arch_config = tomli.load(file) # Search for a subarchitecture in each arch in the arch_config for arch in [x for x in arch_config if x.startswith(name) and host in arch_config[x]]: diff --git a/catalyst/main.py b/catalyst/main.py index 0de1040f..6e9a2d3e 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -6,7 +6,7 @@ import os import sys import textwrap -import toml +import tomli from DeComp.definitions import (COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS, CONTENTS_DEFINITIONS) @@ -35,7 +35,8 @@ def parse_config(config_files): for config_file in config_files: log.notice('Loading configuration file: %s', config_file) try: - config = toml.load(config_file) + with open(config_file, 'rb') as f: + config = tomli.load(f) for key in config: if key not in valid_config_file_values: log.critical("Unknown option '%s' in config file %s", diff --git a/doc/make_subarch_table_guidexml.py b/doc/make_subarch_table_guidexml.py index 67ed3ccc..3c03f90c 100755 --- a/doc/make_subarch_table_guidexml.py +++ b/doc/make_subarch_table_guidexml.py @@ -5,7 +5,7 @@ import pathlib import sys import textwrap -import toml +import tomli def write_guidexml(arch_to_subarch): @@ -40,7 +40,8 @@ def main(_argv): p = pathlib.Path('arch') for file in p.glob('*.toml'): - data = toml.load(file) + with file.open('rb') as f: + data = tomli.load(f) for arch in [x for x in data if x != 'setarch']: arch_to_subarch.update({arch: list(data[arch].keys())}) From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from lists.gentoo.org (pigeon.gentoo.org [208.92.234.80]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by finch.gentoo.org (Postfix) with ESMTPS id D90EE158087 for ; Sun, 30 Jan 2022 23:17:26 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 231672BC001; Sun, 30 Jan 2022 23:17:26 +0000 (UTC) Received: from smtp.gentoo.org (woodpecker.gentoo.org [140.211.166.183]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by pigeon.gentoo.org (Postfix) with ESMTPS id F1FE22BC001 for ; Sun, 30 Jan 2022 23:17:25 +0000 (UTC) Received: from oystercatcher.gentoo.org (oystercatcher.gentoo.org [148.251.78.52]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by smtp.gentoo.org (Postfix) with ESMTPS id EBC43342EB7 for ; Sun, 30 Jan 2022 23:17:24 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 6D03F166 for ; Sun, 30 Jan 2022 23:17:23 +0000 (UTC) From: "Matt Turner" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Matt Turner" Message-ID: <1643584634.67e93e47d30280594c109b8153a83f0a19c027e5.mattst88@gentoo> Subject: [gentoo-commits] proj/catalyst:wip/mattst88 commit in: catalyst/, doc/, catalyst/base/ X-VCS-Repository: proj/catalyst X-VCS-Files: catalyst/base/stagebase.py catalyst/main.py doc/make_subarch_table_guidexml.py X-VCS-Directories: catalyst/base/ catalyst/ doc/ X-VCS-Committer: mattst88 X-VCS-Committer-Name: Matt Turner X-VCS-Revision: 67e93e47d30280594c109b8153a83f0a19c027e5 X-VCS-Branch: wip/mattst88 Date: Sun, 30 Jan 2022 23:17:23 +0000 (UTC) Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-Id: Gentoo Linux mail X-BeenThere: gentoo-commits@lists.gentoo.org X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Archives-Salt: 2a50a203-cfd2-40c8-8c61-0b89bc262d3f X-Archives-Hash: 738788016314ab8fde17f3e0e20c16ed Message-ID: <20220130231723.xXEtOyALJ8ijEZmyst1kzhoEtt5tMK0YIiTI58CrUmQ@z> commit: 67e93e47d30280594c109b8153a83f0a19c027e5 Author: Matt Turner gentoo org> AuthorDate: Sun Jan 30 20:22:43 2022 +0000 Commit: Matt Turner gentoo org> CommitDate: Sun Jan 30 23:17:14 2022 +0000 URL: https://gitweb.gentoo.org/proj/catalyst.git/commit/?id=67e93e47 catalyst: Switch to tomli The Python community is coalescing around tomli, and tomli is likely to be integrated into the standard library per PEP680. Signed-off-by: Matt Turner gentoo.org> catalyst/base/stagebase.py | 6 +++--- catalyst/main.py | 5 +++-- doc/make_subarch_table_guidexml.py | 5 +++-- 3 files changed, 9 insertions(+), 7 deletions(-) diff --git a/catalyst/base/stagebase.py b/catalyst/base/stagebase.py index 4a1b4eb6..de1e30ef 100644 --- a/catalyst/base/stagebase.py +++ b/catalyst/base/stagebase.py @@ -10,7 +10,7 @@ from pathlib import Path import fasteners import libmount -import toml +import tomli from snakeoil import fileutils from snakeoil.osutils import pjoin @@ -123,8 +123,8 @@ class StageBase(TargetBase, ClearBase, GenBase): log.debug("\tTrying %s", x) name = x[:-len('.toml')] - with open(arch_dir + x) as file: - arch_config = toml.load(file) + with open(arch_dir + x, 'rb') as file: + arch_config = tomli.load(file) # Search for a subarchitecture in each arch in the arch_config for arch in [x for x in arch_config if x.startswith(name) and host in arch_config[x]]: diff --git a/catalyst/main.py b/catalyst/main.py index 0de1040f..6e9a2d3e 100644 --- a/catalyst/main.py +++ b/catalyst/main.py @@ -6,7 +6,7 @@ import os import sys import textwrap -import toml +import tomli from DeComp.definitions import (COMPRESS_DEFINITIONS, DECOMPRESS_DEFINITIONS, CONTENTS_DEFINITIONS) @@ -35,7 +35,8 @@ def parse_config(config_files): for config_file in config_files: log.notice('Loading configuration file: %s', config_file) try: - config = toml.load(config_file) + with open(config_file, 'rb') as f: + config = tomli.load(f) for key in config: if key not in valid_config_file_values: log.critical("Unknown option '%s' in config file %s", diff --git a/doc/make_subarch_table_guidexml.py b/doc/make_subarch_table_guidexml.py index 67ed3ccc..3c03f90c 100755 --- a/doc/make_subarch_table_guidexml.py +++ b/doc/make_subarch_table_guidexml.py @@ -5,7 +5,7 @@ import pathlib import sys import textwrap -import toml +import tomli def write_guidexml(arch_to_subarch): @@ -40,7 +40,8 @@ def main(_argv): p = pathlib.Path('arch') for file in p.glob('*.toml'): - data = toml.load(file) + with file.open('rb') as f: + data = tomli.load(f) for arch in [x for x in data if x != 'setarch']: arch_to_subarch.update({arch: list(data[arch].keys())})