Replace deprecated typing imports

More specific modules (like collections.abc) can now be used.

Generated with: ruff check --extend-select UP035 --fix

(cherry picked from commit ced002c4ab)
This commit is contained in:
Štěpán Balážik 2026-02-10 16:12:57 +01:00
parent c04b9251aa
commit 6e91738efe
36 changed files with 42 additions and 35 deletions

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.rdatatype
import dns.rrset

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.rdatatype
import dns.rrset

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.name
import dns.rcode

View file

@ -11,9 +11,9 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from collections.abc import AsyncGenerator
from dataclasses import dataclass
from enum import Enum
from typing import AsyncGenerator
import abc
import logging

View file

@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.edns
import dns.name

View file

@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import logging

View file

@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.opcode
import dns.rcode

View file

@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.rcode

View file

@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.flags
import dns.rcode

View file

@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.rdatatype
import dns.rrset

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.rcode
import dns.rdatatype

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.rdatatype
import dns.rrset

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.name
import dns.rcode

View file

@ -11,8 +11,9 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from collections.abc import AsyncGenerator, Callable, Coroutine, Sequence
from dataclasses import dataclass, field
from typing import Any, AsyncGenerator, Callable, Coroutine, Sequence, cast
from typing import Any, cast
import abc
import asyncio

View file

@ -9,7 +9,8 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from typing import Any, Match, Pattern, TextIO, TypeAlias, TypeVar
from re import Match, Pattern
from typing import Any, TextIO, TypeAlias, TypeVar
import abc
import os

View file

@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from typing import Iterable
from collections.abc import Iterable
from dns.name import Name

View file

@ -9,7 +9,8 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from typing import Any, Callable
from collections.abc import Callable
from typing import Any
import os
import time

View file

@ -11,8 +11,10 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from collections.abc import Iterator
from re import Match, Pattern
from re import compile as Re
from typing import Iterator, Match, Pattern, TextIO
from typing import TextIO
import abc
import re

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator, Collection, Iterable
from collections.abc import AsyncGenerator, Collection, Iterable
import abc

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator, Collection, Iterable
from collections.abc import AsyncGenerator, Collection, Iterable
import abc

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator, Collection, Iterable
from collections.abc import AsyncGenerator, Collection, Iterable
import abc

View file

@ -15,9 +15,9 @@
# https://github.com/pylint-dev/pylint/issues/10785#issuecomment-3677224217
# pylint: disable=unreachable
from collections.abc import Container, Iterable
from dataclasses import dataclass
from pathlib import Path
from typing import Container, Iterable
import os

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.name
import dns.rcode

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.rcode
import dns.rdatatype

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import abc

View file

@ -9,7 +9,7 @@
# See the COPYRIGHT file distributed with this work for additional
# information regarding copyright ownership.
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.rcode
import dns.rdatatype

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.name
import dns.rcode

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.name
import dns.rcode

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import abc

View file

@ -11,7 +11,8 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator, NamedTuple
from collections.abc import AsyncGenerator
from typing import NamedTuple
import abc

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.rcode
import dns.rdatatype

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.rcode
import dns.rdatatype

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.flags

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import dns.rcode
import dns.rdatatype

View file

@ -11,7 +11,7 @@ See the COPYRIGHT file distributed with this work for additional
information regarding copyright ownership.
"""
from typing import AsyncGenerator
from collections.abc import AsyncGenerator
import ipaddress

View file

@ -101,6 +101,7 @@ lint.select = [
# unnecessary `typing` imports
"UP006",
"UP007",
"UP035",
"UP045",
# f-strings
"UP031",