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 919A8158041 for ; Fri, 29 Mar 2024 16:36:48 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 9BBE32BC013; Fri, 29 Mar 2024 16:36:47 +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 7DACC2BC013 for ; Fri, 29 Mar 2024 16:36:47 +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 910533430E7 for ; Fri, 29 Mar 2024 16:36:46 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id 918341107 for ; Fri, 29 Mar 2024 16:36:44 +0000 (UTC) From: "Arthur Zamarin" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Arthur Zamarin" Message-ID: <1711730054.2888daf8f23453f8fda514761e81cdc4963104e6.arthurzam@gentoo> Subject: [gentoo-commits] proj/pkgcore/pkgcore:master commit in: src/pkgcore/repository/ X-VCS-Repository: proj/pkgcore/pkgcore X-VCS-Files: src/pkgcore/repository/prototype.py X-VCS-Directories: src/pkgcore/repository/ X-VCS-Committer: arthurzam X-VCS-Committer-Name: Arthur Zamarin X-VCS-Revision: 2888daf8f23453f8fda514761e81cdc4963104e6 X-VCS-Branch: master Date: Fri, 29 Mar 2024 16:36:44 +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: 6b7d9435-16f7-437d-bd06-b1ed7a0ef5cc X-Archives-Hash: 05b0f9e23ec9fe0734eb33a1f6aca987 commit: 2888daf8f23453f8fda514761e81cdc4963104e6 Author: Arthur Zamarin gentoo org> AuthorDate: Fri Mar 29 16:34:14 2024 +0000 Commit: Arthur Zamarin gentoo org> CommitDate: Fri Mar 29 16:34:14 2024 +0000 URL: https://gitweb.gentoo.org/proj/pkgcore/pkgcore.git/commit/?id=2888daf8 Revert "refactor: leverage ABC protections for prototype.tree" This change broke ConfiguredTree, since it was implementing the ABC function through the `__getattr__` magic. While good intentions, reality hit us. Reverts: cc6a8d054363561890bb0552f1439a8ace92b367 Signed-off-by: Arthur Zamarin gentoo.org> src/pkgcore/repository/prototype.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/src/pkgcore/repository/prototype.py b/src/pkgcore/repository/prototype.py index 656f8e556..9424459c0 100644 --- a/src/pkgcore/repository/prototype.py +++ b/src/pkgcore/repository/prototype.py @@ -15,7 +15,6 @@ from ..ebuild.atom import atom from ..operations import repo from ..restrictions import boolean, packages, restriction, values from ..restrictions.util import collect_package_restrictions -import abc class CategoryLazyFrozenSet: @@ -95,8 +94,8 @@ class VersionMapping(DictMixin): self._cache.pop(key, None) -class tree(abc.ABC): - """ABC for all repository variants. +class tree: + """Template for all repository variants. Args: frozen (bool): controls whether the repository is mutable or immutable @@ -140,17 +139,14 @@ class tree(abc.ABC): """Return a configured form of the repository.""" raise NotImplementedError(self, "configure") - @abc.abstractmethod def _get_categories(self) -> frozenset[str] | typing.Iterable[str]: """this must return an iterable or tuple of this repo's categories""" raise NotImplementedError(self, "_get_categories") - @abc.abstractmethod def _get_packages(self, category: str) -> tuple[str] | typing.Iterable[str]: """Receives category and must return the packages of that cat. Converted to tuple""" raise NotImplementedError(self, "_get_packages") - @abc.abstractmethod def _get_versions( self, package: tuple[str, str] ) -> tuple[str] | typing.Iterable[str]: