bump / refactor code refs
This commit is contained in:
parent
9856d8c7c5
commit
83470fb29e
|
|
@ -18,7 +18,7 @@ from .api_version import INVENTREE_API_TEXT, INVENTREE_API_VERSION
|
|||
INVENTREE_SW_VERSION = '1.4.0 dev'
|
||||
|
||||
# Minimum supported Python version
|
||||
MIN_PYTHON_VERSION = (3, 11)
|
||||
MIN_PYTHON_VERSION = (3, 12)
|
||||
|
||||
logger = logging.getLogger('inventree')
|
||||
|
||||
|
|
|
|||
|
|
@ -1,19 +1,7 @@
|
|||
"""Types for settings."""
|
||||
|
||||
import sys
|
||||
from collections.abc import Callable
|
||||
from typing import Any, TypedDict
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
from typing import NotRequired # pragma: no cover
|
||||
else:
|
||||
|
||||
class NotRequired: # pragma: no cover
|
||||
"""NotRequired type helper is only supported with Python 3.11+."""
|
||||
|
||||
def __class_getitem__(cls, item):
|
||||
"""Return the item."""
|
||||
return item
|
||||
from typing import Any, NotRequired, TypedDict
|
||||
|
||||
|
||||
class SettingsKeyType(TypedDict, total=False):
|
||||
|
|
|
|||
|
|
@ -117,8 +117,7 @@ def plugins_file_hash():
|
|||
|
||||
try:
|
||||
with pf.open('rb') as f:
|
||||
# Note: Once we support 3.11 as a minimum, we can use hashlib.file_digest
|
||||
return hashlib.sha256(f.read()).hexdigest()
|
||||
return hashlib.file_digest(f, 'sha256').hexdigest()
|
||||
except Exception:
|
||||
log_error('plugins_file_hash', scope='plugins')
|
||||
return None
|
||||
|
|
|
|||
Loading…
Reference in New Issue