Skip to content

Commit

Permalink
swap staticmethod/lru_cache
Browse files Browse the repository at this point in the history
The test suite breaks with python < 3.10 reporting this
```
[...]
setupsrc/pypdfium2_setup/packaging_base.py:110: in <module>
    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
```
  • Loading branch information
mara004 committed Oct 7, 2023
1 parent ebe19ad commit 0c19ab4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion setupsrc/pypdfium2_setup/packaging_base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 0c19ab4

Please sign in to comment.