remove now unused class ignores

This commit is contained in:
Matthias Mair 2026-06-25 22:00:36 +02:00
parent f6e5e907d9
commit e903d3d3f6
No known key found for this signature in database
GPG Key ID: A593429DDA23B66A
24 changed files with 27 additions and 29 deletions

View File

@ -583,7 +583,7 @@ class Order(
This method must be implemented by any subclass, as the 'company' field may be named differently for different order types (e.g. supplier vs customer).
"""
raise NotImplementedError(f'company() method not implemented for {__class__}') # ty:ignore[unresolved-reference]
raise NotImplementedError(f'company() method not implemented for {__class__}')
@property
def order_address(self):
@ -608,7 +608,7 @@ class Order(
@classmethod
def get_status_class(cls):
"""Return the enumeration class which represents the 'status' field for this model."""
raise NotImplementedError(f'get_status_class() not implemented for {__class__}') # ty:ignore[unresolved-reference]
raise NotImplementedError(f'get_status_class() not implemented for {__class__}')
class PurchaseOrder(TotalPriceMixin, Order):

View File

@ -16,7 +16,7 @@ class ActionMixin:
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.ACTION, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.ACTION, True, __class__)
def action_name(self):
"""Action name for this plugin.

View File

@ -35,7 +35,7 @@ class BarcodeMixin:
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.BARCODE, 'has_barcode', __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.BARCODE, 'has_barcode', __class__)
@property
def has_barcode(self):
@ -105,7 +105,7 @@ class SupplierBarcodeMixin(BarcodeMixin):
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.SUPPLIER_BARCODE, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.SUPPLIER_BARCODE, True, __class__)
def get_field_value(self, key, backup_value=None):
"""Return the value of a barcode field."""

View File

@ -34,4 +34,4 @@ class EventMixin:
def __init__(self):
"""Register the mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.EVENTS, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.EVENTS, True, __class__)

View File

@ -20,7 +20,7 @@ class IconPackMixin:
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.ICON_PACK, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.ICON_PACK, True, __class__)
@classmethod
def _activate_mixin(cls, registry, plugins, *args, **kwargs):
@ -31,5 +31,5 @@ class IconPackMixin:
def icon_packs(self) -> list[IconPack]:
"""Return a list of custom icon packs."""
raise MixinNotImplementedError(
f"{__class__} is missing the 'icon_packs' method" # ty:ignore[unresolved-reference]
f"{__class__} is missing the 'icon_packs' method"
)

View File

@ -73,7 +73,7 @@ class APICallMixin:
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.API_CALL, 'has_api_call', __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.API_CALL, 'has_api_call', __class__)
@property
def has_api_call(self):

View File

@ -27,7 +27,7 @@ class AppMixin:
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.APP, 'has_app', __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.APP, 'has_app', __class__)
@classmethod
def _activate_mixin(

View File

@ -22,7 +22,7 @@ class CurrencyExchangeMixin:
def __init__(self):
"""Register the mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.CURRENCY_EXCHANGE, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.CURRENCY_EXCHANGE, True, __class__)
def update_exchange_rates(self, base_currency: str, symbols: list[str]) -> dict:
"""Update currency exchange rates.

View File

@ -33,7 +33,7 @@ class DataExportMixin:
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.EXPORTER, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.EXPORTER, True, __class__)
def supports_export(
self,

View File

@ -30,7 +30,7 @@ class MachineDriverMixin:
def __init__(self):
"""Initialize the mixin and register it."""
super().__init__()
self.add_mixin(PluginMixinEnum.MACHINE, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.MACHINE, True, __class__)
def get_machine_types(self) -> list[BaseMachineType]:
"""Register custom machine types."""

View File

@ -22,7 +22,7 @@ class NavigationMixin:
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.NAVIGATION, 'has_navigation', __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.NAVIGATION, 'has_navigation', __class__)
self.navigation = self.setup_navigation()
def setup_navigation(self):

View File

@ -30,7 +30,7 @@ class NotificationMixin:
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.NOTIFICATION, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.NOTIFICATION, True, __class__)
def filter_targets(self, targets: list[User]) -> list[User]:
"""Filter notification targets based on the plugin's logic."""

View File

@ -22,7 +22,7 @@ class ReportMixin:
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.REPORT, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.REPORT, True, __class__)
def add_report_context(self, report_instance, model_instance, user, context):
"""Add extra context to the provided report instance.

View File

@ -55,7 +55,7 @@ class ScheduleMixin:
self.scheduled_tasks = []
self.add_mixin(PluginMixinEnum.SCHEDULE, 'has_scheduled_tasks', __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.SCHEDULE, 'has_scheduled_tasks', __class__)
@classmethod
def _activate_mixin(cls, registry, plugins, *args, **kwargs):

View File

@ -38,7 +38,7 @@ class SettingsMixin:
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.SETTINGS, 'has_settings', __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.SETTINGS, 'has_settings', __class__)
self.settings = getattr(self, 'SETTINGS', {})
self.user_settings = getattr(self, 'USER_SETTINGS', {})

View File

@ -27,9 +27,7 @@ class TransitionMixin:
"""Initialize the mixin and register it."""
super().__init__()
self.add_mixin(
PluginMixinEnum.STATE_TRANSITION,
'has_transition_handlers',
__class__, # ty:ignore[unresolved-reference]
PluginMixinEnum.STATE_TRANSITION, 'has_transition_handlers', __class__
)
@property

View File

@ -22,7 +22,7 @@ class UrlsMixin:
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.URLS, 'has_urls', __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.URLS, 'has_urls', __class__)
self.urls = self.setup_urls()
@classmethod

View File

@ -48,7 +48,7 @@ class ValidationMixin:
def __init__(self):
"""Register the mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.VALIDATION, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.VALIDATION, True, __class__)
def raise_error(self, message):
"""Raise a ValidationError with the given message."""

View File

@ -34,7 +34,7 @@ class LabelPrintingMixin:
def __init__(self): # pragma: no cover
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.LABELS, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.LABELS, True, __class__)
BLOCKING_PRINT = True

View File

@ -32,7 +32,7 @@ class LocateMixin:
def __init__(self):
"""Register the mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.LOCATE, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.LOCATE, True, __class__)
def locate_stock_item(self, item_pk):
"""Attempt to locate a particular StockItem.

View File

@ -36,4 +36,4 @@ class MailMixin:
def __init__(self):
"""Register the mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.MAIL, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.MAIL, True, __class__)

View File

@ -28,7 +28,7 @@ class SupplierMixin(SettingsMixin, Generic[PartData]):
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.SUPPLIER, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.SUPPLIER, True, __class__)
self.SETTINGS['SUPPLIER'] = {
'name': 'Supplier',

View File

@ -84,7 +84,7 @@ class UserInterfaceMixin:
def __init__(self):
"""Register mixin."""
super().__init__()
self.add_mixin(PluginMixinEnum.USER_INTERFACE, True, __class__) # ty:ignore[unresolved-reference]
self.add_mixin(PluginMixinEnum.USER_INTERFACE, True, __class__)
def get_ui_features(
self, feature_type: FeatureType, context: dict, request: Request, **kwargs

View File

@ -11,7 +11,7 @@ class BadActorPlugin(InvenTreePlugin):
def __init__(self, *args, **kwargs):
"""Initialize the plugin."""
super().__init__(*args, **kwargs)
self.add_mixin('settings', 'has_settings', __class__) # ty:ignore[unresolved-reference]
self.add_mixin('settings', 'has_settings', __class__)
def plugin_slug(self) -> str:
"""Return the slug of this plugin."""