From 75a9cc3367728799b333aee33df01c2fce8248f9 Mon Sep 17 00:00:00 2001 From: Nick Sweeting Date: Tue, 12 Nov 2024 02:03:20 -0800 Subject: [PATCH] Update binprovider.py --- pydantic_pkgr/binprovider.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/pydantic_pkgr/binprovider.py b/pydantic_pkgr/binprovider.py index e05636a..9bc0d08 100755 --- a/pydantic_pkgr/binprovider.py +++ b/pydantic_pkgr/binprovider.py @@ -205,9 +205,15 @@ class BinProvider(BaseModel): _install_timeout: int = 120 _version_timeout: int = 10 _cache: Dict[str, Dict[str, Any]] | None = None - _INSTALLER_BIN_ABSPATH: HostBinPath | None = None # speed optimization only, faster to cache the abspath than to recompute it on every access + _INSTALLER_BIN_ABSPATH: HostBinPath | None = None # speed optimization only, faster to cache the abspath than to recompute it on every access _INSTALLER_BINARY: ShallowBinary | None = None # speed optimization only, faster to cache the binary than to recompute it on every access + def __eq__(self, other: Any) -> bool: + try: + return dict(self) == dict(other) # only compare pydantic fields, ignores classvars/@properties/@cached_properties/_fields/etc. + except Exception: + return False + @property def EUID(self) -> int: """