remove old cache wrapper (#32653)

* remove wrapper that is functools.cache

* format
pull/32654/head
Shane Smiskol 11 months ago committed by GitHub
parent 9ce380d3ce
commit 451e171ad9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      common/git.py
  2. 12
      common/utils.py
  3. 3
      system/version.py

@ -1,5 +1,5 @@
from functools import cache
import subprocess
from openpilot.common.utils import cache
from openpilot.common.run import run_cmd, run_cmd_default

@ -1,11 +1,3 @@
from collections.abc import Callable
from functools import lru_cache
from typing import TypeVar
_RT = TypeVar("_RT")
class Freezable:
_frozen: bool = False
@ -17,7 +9,3 @@ class Freezable:
if self._frozen:
raise Exception("cannot modify frozen object")
super().__setattr__(*args, **kwargs)
def cache(user_function: Callable[..., _RT], /) -> Callable[..., _RT]:
return lru_cache(maxsize=None)(user_function)

@ -1,14 +1,13 @@
#!/usr/bin/env python3
from dataclasses import dataclass
from functools import cache
import json
import os
import pathlib
import subprocess
from openpilot.common.basedir import BASEDIR
from openpilot.common.swaglog import cloudlog
from openpilot.common.utils import cache
from openpilot.common.git import get_commit, get_origin, get_branch, get_short_branch, get_commit_date
RELEASE_BRANCHES = ['release3-staging', 'release3', 'nightly']

Loading…
Cancel
Save