Skip to content

Commit

Permalink
Use typing-extensions
Browse files Browse the repository at this point in the history
  • Loading branch information
monosans committed Oct 25, 2023
1 parent a897345 commit 14f19c6
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 12 deletions.
1 change: 1 addition & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -36,4 +36,5 @@ repos:
additional_dependencies:
- aiohttp<4
- rich<14
- typing-extensions<5
- uvloop<0.20; implementation_name == "cpython" and (sys_platform == "darwin" or sys_platform == "linux")
14 changes: 3 additions & 11 deletions proxy_scraper_checker/proxy_scraper_checker.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@
Optional,
Set,
Tuple,
Type,
TypeVar,
Union,
)

Expand All @@ -31,6 +29,7 @@
TextColumn,
)
from rich.table import Table
from typing_extensions import Self

from . import sort, validators
from .folder import Folder
Expand All @@ -39,10 +38,6 @@

logger = logging.getLogger(__name__)

TProxyScraperChecker = TypeVar(
"TProxyScraperChecker", bound="ProxyScraperChecker"
)


class ProxyScraperChecker:
"""HTTP, SOCKS4, SOCKS5 proxies scraper and checker."""
Expand Down Expand Up @@ -157,11 +152,8 @@ def __init__(

@classmethod
def from_configparser(
cls: Type[TProxyScraperChecker],
cfg: ConfigParser,
*,
console: Optional[Console] = None,
) -> TProxyScraperChecker:
cls, cfg: ConfigParser, *, console: Optional[Console] = None
) -> Self:
general = cfg["General"]
folders = cfg["Folders"]
http = cfg["HTTP"]
Expand Down
4 changes: 3 additions & 1 deletion proxy_scraper_checker/validators.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@
import asyncio
import logging
import sys
from typing import Any, Iterable, Optional
from typing import Iterable, Optional
from urllib.parse import urlparse

from typing_extensions import Any

from .folder import Folder

logger = logging.getLogger(__name__)
Expand Down
1 change: 1 addition & 0 deletions requirements-termux.txt
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
aiohttp-socks>=0.7,<0.9
aiohttp>=3.8,<4
rich>=12.3,<14
typing-extensions>=4.4,<5
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ aiodns>=3.0,<4
aiohttp-socks>=0.7,<0.9
aiohttp>=3.8,<4
rich>=12.3,<14
typing-extensions>=4.4,<5
uvloop>=0.16,<0.20; implementation_name == "cpython" and (sys_platform == "darwin" or sys_platform == "linux")

0 comments on commit 14f19c6

Please sign in to comment.