Removes support for Python 3.8 and lower from the code base

This commit is contained in:
Trenton Holmes
2023-09-09 09:08:55 -07:00
committed by Trenton H
parent c8bfbb9315
commit 650c816a7b
34 changed files with 195 additions and 337 deletions

View File

@@ -3,14 +3,12 @@ import tempfile
import time
import warnings
from collections import namedtuple
from collections.abc import Iterator
from contextlib import contextmanager
from os import PathLike
from pathlib import Path
from typing import Any
from typing import Callable
from typing import Iterator
from typing import List
from typing import Tuple
from typing import Union
from unittest import mock
@@ -88,10 +86,10 @@ def paperless_environment():
def util_call_with_backoff(
method_or_callable: Callable,
args: Union[List, Tuple],
args: Union[list, tuple],
*,
skip_on_50x_err=True,
) -> Tuple[bool, Any]:
) -> tuple[bool, Any]:
"""
For whatever reason, the images started during the test pipeline like to
segfault sometimes, crash and otherwise fail randomly, when run with the
@@ -219,7 +217,7 @@ class DocumentConsumeDelayMixin:
def get_last_consume_delay_call_args(
self,
) -> Tuple[ConsumableDocument, DocumentMetadataOverrides]:
) -> tuple[ConsumableDocument, DocumentMetadataOverrides]:
"""
Returns the most recent arguments to the async task
"""
@@ -233,7 +231,7 @@ class DocumentConsumeDelayMixin:
def get_all_consume_delay_call_args(
self,
) -> Iterator[Tuple[ConsumableDocument, DocumentMetadataOverrides]]:
) -> Iterator[tuple[ConsumableDocument, DocumentMetadataOverrides]]:
"""
Iterates over all calls to the async task and returns the arguments
"""
@@ -246,7 +244,7 @@ class DocumentConsumeDelayMixin:
def get_specific_consume_delay_call_args(
self,
index: int,
) -> Iterator[Tuple[ConsumableDocument, DocumentMetadataOverrides]]:
) -> Iterator[tuple[ConsumableDocument, DocumentMetadataOverrides]]:
"""
Returns the arguments of a specific call to the async task
"""