From f8fef61e61ce26d020721185ab89617bea2c0e95 Mon Sep 17 00:00:00 2001 From: Tobias Reiher Date: Tue, 22 Oct 2024 12:02:09 +0200 Subject: [PATCH] Replace deprecated type annotations Ref. eng/recordflux/RecordFlux!1688 --- examples/apps/wireguard/handlers.py | 3 ++- rflx/fatal_error.py | 3 ++- rflx/ls/server.py | 4 ++-- rflx/model/message.py | 3 +-- tests/unit/expr_conv_test.py | 2 +- tests/unit/expr_proof_test.py | 2 +- tests/unit/generator/allocator_test.py | 2 +- tests/unit/generator/common_test.py | 2 +- tests/unit/generator/state_machine_test.py | 3 +-- tests/unit/model/type_decl_test.py | 2 +- 10 files changed, 13 insertions(+), 13 deletions(-) diff --git a/examples/apps/wireguard/handlers.py b/examples/apps/wireguard/handlers.py index e430c346c..9a68445c1 100644 --- a/examples/apps/wireguard/handlers.py +++ b/examples/apps/wireguard/handlers.py @@ -3,8 +3,9 @@ import dataclasses import math import os +from collections.abc import Callable from pathlib import Path -from typing import TYPE_CHECKING, Callable, Optional +from typing import TYPE_CHECKING, Optional from rflx.model import NeverVerify from rflx.pyrflx import MessageValue, PyRFLX diff --git a/rflx/fatal_error.py b/rflx/fatal_error.py index 809f2308d..685c605ce 100644 --- a/rflx/fatal_error.py +++ b/rflx/fatal_error.py @@ -3,7 +3,8 @@ import sys import traceback import types -from typing import Callable, Final +from collections.abc import Callable +from typing import Final from rflx.version import is_gnat_tracker_release, version diff --git a/rflx/ls/server.py b/rflx/ls/server.py index 61d2cbcfa..58fb0c113 100644 --- a/rflx/ls/server.py +++ b/rflx/ls/server.py @@ -5,9 +5,9 @@ import threading import uuid from collections import defaultdict -from collections.abc import Iterable, Mapping +from collections.abc import Callable, Iterable, Mapping from pathlib import Path -from typing import Callable, Final +from typing import Final from urllib.parse import unquote, urlparse from lsprotocol.types import ( diff --git a/rflx/model/message.py b/rflx/model/message.py index be366568f..b5e3f6611 100644 --- a/rflx/model/message.py +++ b/rflx/model/message.py @@ -2,13 +2,12 @@ import itertools from collections import defaultdict -from collections.abc import Iterable, Mapping, Sequence +from collections.abc import Callable, Iterable, Mapping, Sequence from concurrent.futures import ProcessPoolExecutor from copy import copy from dataclasses import dataclass, field as dataclass_field from enum import Enum from functools import cached_property, partial -from typing import Callable from rflx import expr, expr_proof, ty from rflx.common import Base, indent, indent_next, unique, verbose_repr diff --git a/tests/unit/expr_conv_test.py b/tests/unit/expr_conv_test.py index 7aa6ebe7c..310ff1dc8 100644 --- a/tests/unit/expr_conv_test.py +++ b/tests/unit/expr_conv_test.py @@ -1,4 +1,4 @@ -from typing import Callable +from collections.abc import Callable import pytest diff --git a/tests/unit/expr_proof_test.py b/tests/unit/expr_proof_test.py index 2837431fe..751323910 100644 --- a/tests/unit/expr_proof_test.py +++ b/tests/unit/expr_proof_test.py @@ -1,4 +1,4 @@ -from typing import Callable +from collections.abc import Callable import pytest import z3 diff --git a/tests/unit/generator/allocator_test.py b/tests/unit/generator/allocator_test.py index 1332c83f2..ffacda7e3 100644 --- a/tests/unit/generator/allocator_test.py +++ b/tests/unit/generator/allocator_test.py @@ -1,6 +1,6 @@ from __future__ import annotations -from typing import Callable +from collections.abc import Callable import pytest diff --git a/tests/unit/generator/common_test.py b/tests/unit/generator/common_test.py index a27cd89e4..a976c5a93 100644 --- a/tests/unit/generator/common_test.py +++ b/tests/unit/generator/common_test.py @@ -1,7 +1,7 @@ from __future__ import annotations import textwrap -from typing import Callable +from collections.abc import Callable import pytest diff --git a/tests/unit/generator/state_machine_test.py b/tests/unit/generator/state_machine_test.py index fa96af4de..9e397b807 100644 --- a/tests/unit/generator/state_machine_test.py +++ b/tests/unit/generator/state_machine_test.py @@ -1,9 +1,8 @@ from __future__ import annotations import typing -from collections.abc import Sequence +from collections.abc import Callable, Sequence from functools import lru_cache -from typing import Callable import pytest import z3 diff --git a/tests/unit/model/type_decl_test.py b/tests/unit/model/type_decl_test.py index 27c6abdf9..e2f261bbd 100644 --- a/tests/unit/model/type_decl_test.py +++ b/tests/unit/model/type_decl_test.py @@ -1,4 +1,4 @@ -from typing import Callable +from collections.abc import Callable import pytest