Try compatibility with Python 3.7

This commit is contained in:
Andras Schmelczer 2022-07-29 09:50:06 +02:00
parent 10b41aadac
commit 85d079fab8
No known key found for this signature in database
GPG key ID: 0EA1BC97D0AB076E
10 changed files with 20 additions and 23 deletions

View file

@ -13,7 +13,7 @@ jobs:
strategy: strategy:
matrix: matrix:
python-version: ["3.8", "3.9", "3.10"] python-version: ["3.7", "3.8", "3.9", "3.10"]
operating-system: [windows-latest, ubuntu-latest] operating-system: [windows-latest, ubuntu-latest]
runs-on: ${{ matrix.operating-system }} runs-on: ${{ matrix.operating-system }}

View file

@ -6,7 +6,6 @@ from typing import (
Callable, Callable,
Generic, Generic,
List, List,
Literal,
Optional, Optional,
Sequence, Sequence,
Tuple, Tuple,
@ -19,6 +18,7 @@ from typing import (
from async_lru import alru_cache from async_lru import alru_cache
from fastapi import FastAPI from fastapi import FastAPI
from tqdm.cli import tqdm from tqdm.cli import tqdm
from typing_extensions import Literal # <= Python 3.7
from ..constants import DASHBOARD_PATH from ..constants import DASHBOARD_PATH
from ..context import get_context from ..context import get_context

View file

@ -5,7 +5,9 @@ from abc import ABC, abstractmethod
from functools import lru_cache from functools import lru_cache
from pathlib import Path from pathlib import Path
from types import TracebackType from types import TracebackType
from typing import IO, Any, List, Literal, Optional, Type, Union, cast from typing import IO, Any, List, Optional, Type, Union, cast
from typing_extensions import Literal # <= Python 3.7
from great_ai.utilities import ConfigFile, get_logger from great_ai.utilities import ConfigFile, get_logger

View file

@ -1,19 +1,8 @@
from functools import wraps from functools import wraps
from typing import ( from typing import Any, Callable, Dict, List, Optional, Set, Tuple, TypeVar, Union, cast
Any,
Callable,
Dict,
List,
Literal,
Optional,
Set,
Tuple,
TypeVar,
Union,
cast,
)
from dill import load from dill import load
from typing_extensions import Literal # <= Python 3.7
from ..context import get_context from ..context import get_context
from ..helper import get_function_metadata_store from ..helper import get_function_metadata_store

View file

@ -2,9 +2,11 @@ from contextvars import ContextVar
from datetime import datetime from datetime import datetime
from time import perf_counter from time import perf_counter
from types import TracebackType from types import TracebackType
from typing import Any, Dict, Generic, List, Literal, Optional, Type, TypeVar, cast from typing import Any, Dict, Generic, List, Optional, Type, TypeVar, cast
from uuid import uuid4 from uuid import uuid4
from typing_extensions import Literal # <= Python 3.7
from ..constants import DEVELOPMENT_TAG_NAME, ONLINE_TAG_NAME, PRODUCTION_TAG_NAME from ..constants import DEVELOPMENT_TAG_NAME, ONLINE_TAG_NAME, PRODUCTION_TAG_NAME
from ..context import get_context from ..context import get_context
from ..views import Model, Trace from ..views import Model, Trace

View file

@ -3,7 +3,6 @@ from typing import (
Awaitable, Awaitable,
Callable, Callable,
Iterable, Iterable,
Literal,
Optional, Optional,
Sequence, Sequence,
TypeVar, TypeVar,
@ -12,6 +11,7 @@ from typing import (
) )
import dill import dill
from typing_extensions import Literal # <= Python 3.7
from .get_config import get_config from .get_config import get_config
from .manage_communication import manage_communication from .manage_communication import manage_communication

View file

@ -4,7 +4,6 @@ from typing import (
Awaitable, Awaitable,
Callable, Callable,
Iterable, Iterable,
Literal,
Optional, Optional,
Sequence, Sequence,
TypeVar, TypeVar,
@ -12,6 +11,8 @@ from typing import (
overload, overload,
) )
from typing_extensions import Literal # <= Python 3.7
from .get_config import get_config from .get_config import get_config
from .manage_communication import manage_communication from .manage_communication import manage_communication
from .mapper_function import mapper_function from .mapper_function import mapper_function

View file

@ -1,4 +1,6 @@
from typing import List, Literal from typing import List
from typing_extensions import Literal # <= Python 3.7
Operator = Literal[">=", "<=", "<", ">", "!=", "=", "contains"] Operator = Literal[">=", "<=", "<", ">", "!=", "=", "contains"]

View file

@ -1,4 +1,6 @@
from typing import Any, List, Literal, Optional from typing import Any, List, Optional
from typing_extensions import Literal # <= Python 3.7
from ..hashable_base_model import HashableBaseModel from ..hashable_base_model import HashableBaseModel

View file

@ -1,6 +1,5 @@
from typing import Literal
from pydantic import BaseModel from pydantic import BaseModel
from typing_extensions import Literal # <= Python 3.7
class SortBy(BaseModel): class SortBy(BaseModel):