remove old cache wrapper (#32653)

* remove wrapper that is functools.cache

* format
This commit is contained in:
Shane Smiskol 2024-06-07 21:24:32 -07:00 committed by GitHub
parent 9ce380d3ce
commit 451e171ad9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 2 additions and 15 deletions

View File

@ -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

View File

@ -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)

View File

@ -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']