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 A65E915800F for ; Thu, 26 Jan 2023 14:33:33 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 4B4DAE07FE; Thu, 26 Jan 2023 14:33:32 +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 30E8BE07FE for ; Thu, 26 Jan 2023 14:33:32 +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 09D5E340D5F for ; Thu, 26 Jan 2023 14:33:31 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 94E8588C for ; Thu, 26 Jan 2023 14:33:28 +0000 (UTC) From: "Michał Górny" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Michał Górny" Message-ID: <1674743601.aa8da0c8d86b04859bf4f3f944bffbef1b772914.mgorny@gentoo> Subject: [gentoo-commits] repo/gentoo:master commit in: dev-python/pylama/, dev-python/pylama/files/ X-VCS-Repository: repo/gentoo X-VCS-Files: dev-python/pylama/files/pylama-8.4.1-tomli.patch dev-python/pylama/pylama-8.4.1-r1.ebuild dev-python/pylama/pylama-8.4.1.ebuild X-VCS-Directories: dev-python/pylama/ dev-python/pylama/files/ X-VCS-Committer: mgorny X-VCS-Committer-Name: Michał Górny X-VCS-Revision: aa8da0c8d86b04859bf4f3f944bffbef1b772914 X-VCS-Branch: master Date: Thu, 26 Jan 2023 14:33:28 +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: cdde0c50-4ee6-4391-b75f-d57cf4c9f92c X-Archives-Hash: 7fae37fa853ce638a24e0f7149296029 commit: aa8da0c8d86b04859bf4f3f944bffbef1b772914 Author: Michał Górny gentoo org> AuthorDate: Thu Jan 26 14:32:54 2023 +0000 Commit: Michał Górny gentoo org> CommitDate: Thu Jan 26 14:33:21 2023 +0000 URL: https://gitweb.gentoo.org/repo/gentoo.git/commit/?id=aa8da0c8 dev-python/pylama: Port to tomllib/tomli Signed-off-by: Michał Górny gentoo.org> dev-python/pylama/files/pylama-8.4.1-tomli.patch | 69 ++++++++++++++++++++++ ...{pylama-8.4.1.ebuild => pylama-8.4.1-r1.ebuild} | 18 +++++- 2 files changed, 84 insertions(+), 3 deletions(-) diff --git a/dev-python/pylama/files/pylama-8.4.1-tomli.patch b/dev-python/pylama/files/pylama-8.4.1-tomli.patch new file mode 100644 index 000000000000..291bc9f530e7 --- /dev/null +++ b/dev-python/pylama/files/pylama-8.4.1-tomli.patch @@ -0,0 +1,69 @@ +From 8b7908fec960a05af0a0a9b10d24ed458fcf97c7 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Micha=C5=82=20G=C3=B3rny?= +Date: Tue, 8 Nov 2022 14:33:59 +0100 +Subject: [PATCH] Use tomli/tomllib instead of the unmaintained toml package + +Replace the use of the unmaintained `toml` package with the modern +alternatives: the built-in `tomllib` in Python 3.11+, and its equivalent +`tomli` in older Python versions. `tomli` installs type stubs, so there +is no need for an additional `types-*` package for it. +--- + pylama/config_toml.py | 9 +++++++-- + requirements/requirements-tests.txt | 3 +-- + setup.py | 2 +- + 3 files changed, 9 insertions(+), 5 deletions(-) + +diff --git a/pylama/config_toml.py b/pylama/config_toml.py +index 2af02a5..ea6e17a 100644 +--- a/pylama/config_toml.py ++++ b/pylama/config_toml.py +@@ -1,16 +1,21 @@ + """Pylama TOML configuration.""" + +-import toml ++import sys + + from pylama.libs.inirama import Namespace as _Namespace + ++if sys.version_info >= (3, 11): ++ import tomllib ++else: ++ import tomli as tomllib ++ + + class Namespace(_Namespace): + """Inirama-style wrapper for TOML config.""" + + def parse(self, source: str, update: bool = True, **params): + """Parse TOML source as string.""" +- content = toml.loads(source) ++ content = tomllib.loads(source) + tool = content.get("tool", {}) + pylama = tool.get("pylama", {}) + linters = pylama.pop("linter", {}) +diff --git a/requirements/requirements-tests.txt b/requirements/requirements-tests.txt +index d786f1f..e62ccae 100644 +--- a/requirements/requirements-tests.txt ++++ b/requirements/requirements-tests.txt +@@ -5,8 +5,7 @@ radon >= 5.1.0 + mypy + pylint >= 2.11.1 + pylama-quotes +-toml ++tomli >= 1.2.3 ; python_version < "3.11" + vulture + + types-setuptools +-types-toml +diff --git a/setup.py b/setup.py +index 911aea6..6d0222b 100644 +--- a/setup.py ++++ b/setup.py +@@ -21,6 +21,6 @@ def parse_requirements(path: str) -> "list[str]": + extras_require=dict( + tests=parse_requirements("requirements/requirements-tests.txt"), + all=OPTIONAL_LINTERS, **{linter: [linter] for linter in OPTIONAL_LINTERS}, +- toml="toml>=0.10.2", ++ toml="tomli>=1.2.3; python_version < '3.11'", + ), + ) diff --git a/dev-python/pylama/pylama-8.4.1.ebuild b/dev-python/pylama/pylama-8.4.1-r1.ebuild similarity index 75% rename from dev-python/pylama/pylama-8.4.1.ebuild rename to dev-python/pylama/pylama-8.4.1-r1.ebuild index 0d21af8a8555..c1a76432c6e9 100644 --- a/dev-python/pylama/pylama-8.4.1.ebuild +++ b/dev-python/pylama/pylama-8.4.1-r1.ebuild @@ -9,8 +9,14 @@ PYTHON_COMPAT=( python3_{9..11} ) inherit distutils-r1 DESCRIPTION="Code audit tool for python" -HOMEPAGE="https://github.com/klen/pylama" -SRC_URI="https://github.com/klen/pylama/archive/${PV}.tar.gz -> ${P}.gh.tar.gz" +HOMEPAGE=" + https://github.com/klen/pylama/ + https://pypi.org/project/pylama/ +" +SRC_URI=" + https://github.com/klen/pylama/archive/${PV}.tar.gz + -> ${P}.gh.tar.gz +" LICENSE="MIT" SLOT="0" @@ -28,13 +34,19 @@ BDEPEND=" dev-python/mypy[${PYTHON_USEDEP}] dev-python/pylint[${PYTHON_USEDEP}] dev-python/radon[${PYTHON_USEDEP}] - dev-python/toml[${PYTHON_USEDEP}] dev-vcs/git + $(python_gen_cond_dep ' + dev-python/tomli[${PYTHON_USEDEP}] + ' 3.{8..10}) ) " distutils_enable_tests pytest +PATCHES=( + "${FILESDIR}"/${P}-tomli.patch +) + EPYTEST_DESELECT=( # not packaged tests/test_linters.py::test_quotes