diff --git a/projects/fal/src/fal/workflows.py b/projects/fal/src/fal/workflows.py index 087814a1..f193d52a 100644 --- a/projects/fal/src/fal/workflows.py +++ b/projects/fal/src/fal/workflows.py @@ -5,7 +5,7 @@ from argparse import ArgumentParser from collections import Counter from dataclasses import dataclass, field -from typing import Any, Iterator, Union, cast +from typing import Any, Dict, Iterator, List, Union, cast import graphlib import rich @@ -21,8 +21,8 @@ from fal.exceptions import FalServerlessException from fal.rest_client import REST_CLIENT -JSONType = Union[dict[str, Any], list[Any], str, int, float, bool, None, "Leaf"] -SchemaType = dict[str, Any] +JSONType = Union[Dict[str, Any], List[Any], str, int, float, bool, None, "Leaf"] +SchemaType = Dict[str, Any] VARIABLE_PREFIX = "$" INPUT_VARIABLE_NAME = "input" diff --git a/projects/fal/tests/cli/test_run.py b/projects/fal/tests/cli/test_run.py index 05c88e34..542087e6 100644 --- a/projects/fal/tests/cli/test_run.py +++ b/projects/fal/tests/cli/test_run.py @@ -1,3 +1,4 @@ +from typing import Optional, Tuple from unittest.mock import MagicMock, patch import pytest @@ -34,7 +35,7 @@ def mocked_fal_serverless_host(host): return mock -def mock_args(host, func_ref: tuple[str]): +def mock_args(host, func_ref: Tuple[str, Optional[str]]): args = MagicMock() args.host = host args.func_ref = func_ref diff --git a/projects/fal/tests/test_apps.py b/projects/fal/tests/test_apps.py index 6e17a5a1..4a6fa73b 100644 --- a/projects/fal/tests/test_apps.py +++ b/projects/fal/tests/test_apps.py @@ -5,7 +5,7 @@ import time from contextlib import contextmanager, suppress from datetime import datetime -from typing import Generator +from typing import Generator, List, Tuple import fal import fal.api as api @@ -224,7 +224,7 @@ class RTOutput(BaseModel): class RTOutputs(BaseModel): - texts: list[str] + texts: List[str] class RealtimeApp(fal.App, keep_alive=300, max_concurrency=1): @@ -252,7 +252,7 @@ def generate_rt_batched(self, input: RTInput, *inputs: RTInput) -> RTOutputs: @pytest.fixture(scope="module") -def aliased_app() -> Generator[tuple[str, str], None, None]: +def aliased_app() -> Generator[Tuple[str, str], None, None]: # Create a temporary app, register it, and return the ID of it. import uuid @@ -516,7 +516,7 @@ def test_404_response(test_app: str, request: pytest.FixtureRequest): apps.run(test_app, path="/other", arguments={"lhs": 1, "rhs": 2}) -def test_app_deploy_scale(aliased_app: tuple[str, str]): +def test_app_deploy_scale(aliased_app: Tuple[str, str]): import uuid from dataclasses import replace @@ -558,7 +558,7 @@ def test_app_deploy_scale(aliased_app: tuple[str, str]): assert found.max_multiplexing == 30 -def test_app_update_app(aliased_app: tuple[str, str]): +def test_app_update_app(aliased_app: Tuple[str, str]): app_revision, app_alias = aliased_app host: api.FalServerlessHost = addition_app.host # type: ignore @@ -608,7 +608,7 @@ def test_app_update_app(aliased_app: tuple[str, str]): assert res.max_multiplexing == new_max_multiplexing -def test_app_set_delete_alias(aliased_app: tuple[str, str]): +def test_app_set_delete_alias(aliased_app: Tuple[str, str]): app_revision, app_alias = aliased_app host: api.FalServerlessHost = addition_app.host # type: ignore