bump / refactor code refs

This commit is contained in:
Matthias Mair 2026-06-22 22:40:37 +02:00
parent 9856d8c7c5
commit 83470fb29e
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A
3 changed files with 3 additions and 16 deletions

View File

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

View File

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

View File

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