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 0954715800A for ; Mon, 21 Aug 2023 05:16:24 +0000 (UTC) Received: from pigeon.gentoo.org (localhost [127.0.0.1]) by pigeon.gentoo.org (Postfix) with SMTP id 525592BC017; Mon, 21 Aug 2023 05:16:23 +0000 (UTC) Received: from smtp.gentoo.org (mail.gentoo.org [IPv6:2001:470:ea4a:1:5054:ff:fec7:86e4]) (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 1C3C62BC017 for ; Mon, 21 Aug 2023 05:16:23 +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 5EC44340E13 for ; Mon, 21 Aug 2023 05:16:22 +0000 (UTC) Received: from localhost.localdomain (localhost [IPv6:::1]) by oystercatcher.gentoo.org (Postfix) with ESMTP id CAFC2DAC for ; Mon, 21 Aug 2023 05:16:20 +0000 (UTC) From: "Sam James" To: gentoo-commits@lists.gentoo.org Content-Transfer-Encoding: 8bit Content-type: text/plain; charset=UTF-8 Reply-To: gentoo-dev@lists.gentoo.org, "Sam James" Message-ID: <1692594978.d93602634628ee5f0063b14efa52f98b141d2cc9.sam@gentoo> Subject: [gentoo-commits] proj/gentoolkit:master commit in: pym/gentoolkit/eclean/ X-VCS-Repository: proj/gentoolkit X-VCS-Files: pym/gentoolkit/eclean/search.py X-VCS-Directories: pym/gentoolkit/eclean/ X-VCS-Committer: sam X-VCS-Committer-Name: Sam James X-VCS-Revision: d93602634628ee5f0063b14efa52f98b141d2cc9 X-VCS-Branch: master Date: Mon, 21 Aug 2023 05:16:20 +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: 98958255-39ac-4fb3-ba0c-c1b7cc501a6b X-Archives-Hash: 0a630902f986ab3efcaeac3740b6458a commit: d93602634628ee5f0063b14efa52f98b141d2cc9 Author: Siddhanth Rathod gmail com> AuthorDate: Thu Apr 6 15:17:28 2023 +0000 Commit: Sam James gentoo org> CommitDate: Mon Aug 21 05:16:18 2023 +0000 URL: https://gitweb.gentoo.org/proj/gentoolkit.git/commit/?id=d9360263 eclean: Add type hints Signed-off-by: Siddhanth Rathod gmail.com> Signed-off-by: Sam James gentoo.org> pym/gentoolkit/eclean/search.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/pym/gentoolkit/eclean/search.py b/pym/gentoolkit/eclean/search.py index 3288208..eb26ac8 100644 --- a/pym/gentoolkit/eclean/search.py +++ b/pym/gentoolkit/eclean/search.py @@ -8,6 +8,7 @@ import os import stat import sys from functools import partial +from typing import Optional import portage from portage.dep import Atom, use_reduce @@ -508,15 +509,15 @@ def _deps_equal(deps_a, eapi_a, deps_b, eapi_b, uselist=None): def findPackages( - options, - exclude=None, - destructive=False, - time_limit=0, - package_names=False, - pkgdir=None, + options: dict[str, bool], + exclude: Optional[dict] = None, + destructive: bool = False, + time_limit: Optional[int] = 0, + package_names: Optional[bool] = False, + pkgdir: str = None, port_dbapi=portage.db[portage.root]["porttree"].dbapi, var_dbapi=portage.db[portage.root]["vartree"].dbapi, -): +) -> dict[str, list[str]]: """Find obsolete binary packages. @param options: dict of options determined at runtime @@ -563,7 +564,7 @@ def findPackages( # Dictionary of binary packages to clean. Organized as cpv->[pkgs] in order # to support FEATURES=binpkg-multi-instance. - dead_binpkgs = {} + dead_binpkgs: dict[str, list[str]] = {} keep_binpkgs = {} bin_dbapi = portage.binarytree(pkgdir=pkgdir, settings=var_dbapi.settings).dbapi