From 0c19ab496e67557e3773280ee9779e8b04991468 Mon Sep 17 00:00:00 2001 From: geisserml Date: Sat, 7 Oct 2023 21:10:41 +0200 Subject: [PATCH] swap staticmethod/lru_cache The test suite breaks with python < 3.10 reporting this ``` [...] setupsrc/pypdfium2_setup/packaging_base.py:110: in class PdfiumVer: setupsrc/pypdfium2_setup/packaging_base.py:117: in PdfiumVer @staticmethod /opt/hostedtoolcache/Python/3.7.17/x64/lib/python3.7/functools.py:493: in decorating_function wrapper = _lru_cache_wrapper(user_function, maxsize, typed, _CacheInfo) E TypeError: the first argument must be callable [...] ERROR tests_old/test_setup.py - TypeError: the first argument must be callable ``` --- setupsrc/pypdfium2_setup/packaging_base.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/setupsrc/pypdfium2_setup/packaging_base.py b/setupsrc/pypdfium2_setup/packaging_base.py index 71faa22c2..f3afa30fb 100644 --- a/setupsrc/pypdfium2_setup/packaging_base.py +++ b/setupsrc/pypdfium2_setup/packaging_base.py @@ -113,8 +113,8 @@ class PdfiumVer: V_KEYS = ("major", "minor", "build", "patch") # TODO consider cached property? - @functools.lru_cache(maxsize=1) @staticmethod + @functools.lru_cache(maxsize=1) def get_latest(): git_ls = run_cmd(["git", "ls-remote", f"{ReleaseRepo}.git"], cwd=None, capture=True) tag = git_ls.split("\t")[-1]