aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArthur Zamarin <arthurzam@gentoo.org>2024-03-29 19:34:14 +0300
committerArthur Zamarin <arthurzam@gentoo.org>2024-03-29 19:34:14 +0300
commit2888daf8f23453f8fda514761e81cdc4963104e6 (patch)
tree953f80a441ef64a6a6119f14790206d883228378
parentstart work on 0.12.27 (diff)
downloadpkgcore-2888daf8f23453f8fda514761e81cdc4963104e6.tar.gz
pkgcore-2888daf8f23453f8fda514761e81cdc4963104e6.tar.bz2
pkgcore-2888daf8f23453f8fda514761e81cdc4963104e6.zip
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 <arthurzam@gentoo.org>
-rw-r--r--src/pkgcore/repository/prototype.py8
1 files changed, 2 insertions, 6 deletions
diff --git a/src/pkgcore/repository/prototype.py b/src/pkgcore/repository/prototype.py
index 656f8e55..9424459c 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]: