Chore: Drop Python 3.9 support (#7774)

This commit is contained in:
Trenton H
2024-09-26 12:22:24 -07:00
committed by GitHub
parent a3b4198408
commit e3bc680bf1
44 changed files with 970 additions and 1066 deletions

View File

@@ -1,7 +1,6 @@
import abc
from pathlib import Path
from typing import Final
from typing import Optional
from documents.data_models import ConsumableDocument
from documents.data_models import DocumentMetadataOverrides
@@ -88,7 +87,7 @@ class ConsumeTaskPlugin(abc.ABC):
"""
@abc.abstractmethod
def run(self) -> Optional[str]:
def run(self) -> str | None:
"""
The bulk of plugin processing, this does whatever action the plugin is for.

View File

@@ -1,7 +1,5 @@
import enum
from typing import TYPE_CHECKING
from typing import Optional
from typing import Union
from asgiref.sync import async_to_sync
from channels.layers import get_channel_layer
@@ -23,9 +21,9 @@ class ProgressManager:
of the open/close of the layer to ensure messages go out and everything is cleaned up
"""
def __init__(self, filename: str, task_id: Optional[str] = None) -> None:
def __init__(self, filename: str, task_id: str | None = None) -> None:
self.filename = filename
self._channel: Optional[RedisPubSubChannelLayer] = None
self._channel: RedisPubSubChannelLayer | None = None
self.task_id = task_id
def __enter__(self):
@@ -57,7 +55,7 @@ class ProgressManager:
message: str,
current_progress: int,
max_progress: int,
extra_args: Optional[dict[str, Union[str, int, None]]] = None,
extra_args: dict[str, str | int | None] | None = None,
) -> None:
# Ensure the layer is open
self.open()