chore: use absolute imports
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
# ruff: noqa: E402
|
||||
from __future__ import annotations
|
||||
|
||||
from . import logs
|
||||
from proxy_scraper_checker import logs
|
||||
|
||||
_logs_listener = logs.configure()
|
||||
|
||||
@@ -16,9 +16,17 @@ from aiohttp import ClientSession, TCPConnector
|
||||
from rich.progress import BarColumn, MofNCompleteColumn, Progress, TextColumn
|
||||
from rich.table import Table
|
||||
|
||||
from . import checker, geodb, http, output, scraper, sort, utils
|
||||
from .settings import Settings
|
||||
from .storage import ProxyStorage
|
||||
from proxy_scraper_checker import (
|
||||
checker,
|
||||
geodb,
|
||||
http,
|
||||
output,
|
||||
scraper,
|
||||
sort,
|
||||
utils,
|
||||
)
|
||||
from proxy_scraper_checker.settings import Settings
|
||||
from proxy_scraper_checker.storage import ProxyStorage
|
||||
|
||||
if sys.version_info >= (3, 11):
|
||||
try:
|
||||
|
||||
@@ -4,8 +4,8 @@ import asyncio
|
||||
import logging
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from . import sort
|
||||
from .counter import IncrInt
|
||||
from proxy_scraper_checker import sort
|
||||
from proxy_scraper_checker.counter import IncrInt
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Mapping
|
||||
@@ -13,9 +13,9 @@ if TYPE_CHECKING:
|
||||
from aiohttp_socks import ProxyType
|
||||
from rich.progress import Progress, TaskID
|
||||
|
||||
from .proxy import Proxy
|
||||
from .settings import Settings
|
||||
from .storage import ProxyStorage
|
||||
from proxy_scraper_checker.proxy import Proxy
|
||||
from proxy_scraper_checker.settings import Settings
|
||||
from proxy_scraper_checker.storage import ProxyStorage
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ from typing import TYPE_CHECKING
|
||||
import aiofiles
|
||||
from aiohttp import hdrs
|
||||
|
||||
from . import fs
|
||||
from .utils import IS_DOCKER, bytes_decode
|
||||
from proxy_scraper_checker import fs
|
||||
from proxy_scraper_checker.utils import IS_DOCKER, bytes_decode
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from aiohttp import ClientResponse, ClientSession
|
||||
|
||||
@@ -8,7 +8,7 @@ from typing import TYPE_CHECKING
|
||||
import certifi
|
||||
from aiohttp import DummyCookieJar, hdrs
|
||||
|
||||
from .utils import bytes_decode
|
||||
from proxy_scraper_checker.utils import bytes_decode
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from aiohttp import ClientResponse
|
||||
|
||||
@@ -8,17 +8,17 @@ from typing import TYPE_CHECKING
|
||||
|
||||
import maxminddb
|
||||
|
||||
from . import fs, sort
|
||||
from .geodb import GEODB_PATH
|
||||
from .null_context import NullContext
|
||||
from .utils import IS_DOCKER
|
||||
from proxy_scraper_checker import fs, sort
|
||||
from proxy_scraper_checker.geodb import GEODB_PATH
|
||||
from proxy_scraper_checker.null_context import NullContext
|
||||
from proxy_scraper_checker.utils import IS_DOCKER
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Sequence
|
||||
|
||||
from .proxy import Proxy
|
||||
from .settings import Settings
|
||||
from .storage import ProxyStorage
|
||||
from proxy_scraper_checker.proxy import Proxy
|
||||
from proxy_scraper_checker.settings import Settings
|
||||
from proxy_scraper_checker.storage import ProxyStorage
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -9,20 +9,20 @@ import attrs
|
||||
from aiohttp import ClientSession
|
||||
from aiohttp_socks import ProxyConnector
|
||||
|
||||
from .http import (
|
||||
from proxy_scraper_checker.http import (
|
||||
HEADERS,
|
||||
SSL_CONTEXT,
|
||||
fallback_charset_resolver,
|
||||
get_cookie_jar,
|
||||
get_response_text,
|
||||
)
|
||||
from .parsers import parse_ipv4
|
||||
from .settings import CheckWebsiteType
|
||||
from proxy_scraper_checker.parsers import parse_ipv4
|
||||
from proxy_scraper_checker.settings import CheckWebsiteType
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from aiohttp_socks import ProxyType
|
||||
|
||||
from .settings import Settings
|
||||
from proxy_scraper_checker.settings import Settings
|
||||
|
||||
|
||||
@attrs.define(
|
||||
|
||||
@@ -9,18 +9,18 @@ import aiofiles
|
||||
from aiohttp import ClientResponseError, ClientTimeout
|
||||
from aiohttp_socks import ProxyType
|
||||
|
||||
from .counter import IncrInt
|
||||
from .http import get_response_text
|
||||
from .parsers import PROXY_REGEX
|
||||
from .proxy import Proxy
|
||||
from .utils import bytes_decode, is_http_url
|
||||
from proxy_scraper_checker.counter import IncrInt
|
||||
from proxy_scraper_checker.http import get_response_text
|
||||
from proxy_scraper_checker.parsers import PROXY_REGEX
|
||||
from proxy_scraper_checker.proxy import Proxy
|
||||
from proxy_scraper_checker.utils import bytes_decode, is_http_url
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from aiohttp import ClientSession
|
||||
from rich.progress import Progress, TaskID
|
||||
|
||||
from .settings import Settings
|
||||
from .storage import ProxyStorage
|
||||
from proxy_scraper_checker.settings import Settings
|
||||
from proxy_scraper_checker.storage import ProxyStorage
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -17,11 +17,11 @@ import platformdirs
|
||||
from aiohttp import ClientTimeout, hdrs
|
||||
from aiohttp_socks import ProxyType
|
||||
|
||||
from . import fs, sort
|
||||
from .http import get_response_text
|
||||
from .null_context import NullContext
|
||||
from .parsers import parse_ipv4
|
||||
from .utils import IS_DOCKER
|
||||
from proxy_scraper_checker import fs, sort
|
||||
from proxy_scraper_checker.http import get_response_text
|
||||
from proxy_scraper_checker.null_context import NullContext
|
||||
from proxy_scraper_checker.parsers import parse_ipv4
|
||||
from proxy_scraper_checker.utils import IS_DOCKER
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Iterable, Mapping
|
||||
@@ -30,7 +30,7 @@ if TYPE_CHECKING:
|
||||
from aiohttp import ClientSession
|
||||
from typing_extensions import Any, Literal, Self
|
||||
|
||||
from .proxy import Proxy
|
||||
from proxy_scraper_checker.proxy import Proxy
|
||||
|
||||
_logger = logging.getLogger(__name__)
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@ from typing import TYPE_CHECKING
|
||||
from aiohttp_socks import ProxyType
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from .proxy import Proxy
|
||||
from proxy_scraper_checker.proxy import Proxy
|
||||
|
||||
PROTOCOL_ORDER = (ProxyType.HTTP, ProxyType.SOCKS4, ProxyType.SOCKS5)
|
||||
|
||||
|
||||
@@ -4,14 +4,14 @@ import itertools
|
||||
from collections import Counter
|
||||
from typing import TYPE_CHECKING
|
||||
|
||||
from . import sort
|
||||
from proxy_scraper_checker import sort
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from collections.abc import Iterable, Iterator
|
||||
|
||||
from aiohttp_socks import ProxyType
|
||||
|
||||
from .proxy import Proxy
|
||||
from proxy_scraper_checker.proxy import Proxy
|
||||
|
||||
|
||||
class ProxyStorage:
|
||||
|
||||
@@ -53,7 +53,6 @@ ignore = [
|
||||
"SIM105",
|
||||
"TD002",
|
||||
"TD003",
|
||||
"TID252",
|
||||
"TRY400",
|
||||
]
|
||||
select = ["ALL"]
|
||||
@@ -62,6 +61,9 @@ unfixable = ["RUF027", "T"]
|
||||
[lint.flake8-self]
|
||||
ignore-names = ["_name_", "_value_"]
|
||||
|
||||
[lint.flake8-tidy-imports]
|
||||
ban-relative-imports = "all"
|
||||
|
||||
[lint.flake8-type-checking]
|
||||
exempt-modules = []
|
||||
strict = true
|
||||
|
||||
Reference in New Issue
Block a user