chore: fix import typing issues

This commit is contained in:
bastimeyer 2022-05-23 17:22:29 +02:00 committed by Forrest
parent ec93f520ac
commit 8fc178276e
10 changed files with 10 additions and 16 deletions

View File

@ -4,7 +4,7 @@ from threading import RLock, Thread
from typing import Any, Dict, List, Optional, Tuple, Union from typing import Any, Dict, List, Optional, Tuple, Union
from urllib.parse import unquote_plus, urlparse from urllib.parse import unquote_plus, urlparse
from websocket import ABNF, STATUS_NORMAL, WebSocketApp, enableTrace from websocket import ABNF, STATUS_NORMAL, WebSocketApp, enableTrace # type: ignore[import]
from streamlink.logger import TRACE, root as rootlogger from streamlink.logger import TRACE, root as rootlogger
from streamlink.session import Streamlink from streamlink.session import Streamlink

View File

@ -11,7 +11,7 @@ import re
from datetime import datetime from datetime import datetime
from urllib.parse import urlparse from urllib.parse import urlparse
from isodate import LOCAL as LOCALTIMEZONE from isodate import LOCAL as LOCALTIMEZONE # type: ignore[import]
from streamlink.plugin import Plugin, PluginError, pluginmatcher from streamlink.plugin import Plugin, PluginError, pluginmatcher
from streamlink.plugin.api import useragents, validate from streamlink.plugin.api import useragents, validate

View File

@ -10,7 +10,7 @@ from itertools import count, repeat
from typing import Optional from typing import Optional
from urllib.parse import urljoin, urlparse, urlsplit, urlunparse, urlunsplit from urllib.parse import urljoin, urlparse, urlsplit, urlunparse, urlunsplit
from isodate import Duration, UTC as utc, parse_datetime, parse_duration from isodate import Duration, UTC as utc, parse_datetime, parse_duration # type: ignore[import]
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@ -8,8 +8,7 @@ from itertools import starmap
from typing import Any, Callable, ClassVar, Dict, List, Mapping, NamedTuple, Optional, Tuple, Type, Union from typing import Any, Callable, ClassVar, Dict, List, Mapping, NamedTuple, Optional, Tuple, Type, Union
from urllib.parse import urljoin, urlparse from urllib.parse import urljoin, urlparse
# noinspection PyPackageRequirements from isodate import ISO8601Error, parse_datetime # type: ignore[import]
from isodate import ISO8601Error, parse_datetime
log = logging.getLogger(__name__) log = logging.getLogger(__name__)

View File

@ -2,7 +2,7 @@ import locale
import logging import logging
from typing import Optional from typing import Optional
from pycountry import countries, languages from pycountry import countries, languages # type: ignore[import]
DEFAULT_LANGUAGE = "en" DEFAULT_LANGUAGE = "en"
DEFAULT_COUNTRY = "US" DEFAULT_COUNTRY = "US"

View File

@ -15,8 +15,8 @@ from time import sleep
from typing import Any, Dict, List, Optional, Type, Union from typing import Any, Dict, List, Optional, Type, Union
import requests import requests
from socks import __version__ as socks_version from socks import __version__ as socks_version # type: ignore[import]
from websocket import __version__ as websocket_version from websocket import __version__ as websocket_version # type: ignore[import]
import streamlink.logger as logger import streamlink.logger as logger
from streamlink import NoPluginError, PluginError, StreamError, Streamlink, __version__ as streamlink_version from streamlink import NoPluginError, PluginError, StreamError, Streamlink, __version__ as streamlink_version

View File

@ -1,11 +1,7 @@
import socket import socket
from http.server import BaseHTTPRequestHandler
from io import BytesIO from io import BytesIO
try:
from BaseHTTPServer import BaseHTTPRequestHandler
except ImportError:
from http.server import BaseHTTPRequestHandler
class HTTPRequest(BaseHTTPRequestHandler): class HTTPRequest(BaseHTTPRequestHandler):
def __init__(self, request_text): def __init__(self, request_text):

0
tests/plugin/__init__.py Normal file
View File

View File

@ -1,8 +1,7 @@
import unittest import unittest
from datetime import datetime, timedelta from datetime import datetime, timedelta
# noinspection PyPackageRequirements from isodate import tzinfo # type: ignore[import]
from isodate import tzinfo
from streamlink.stream.hls_playlist import DateRange, M3U8Parser, Media, Resolution, Segment, StreamInfo, load from streamlink.stream.hls_playlist import DateRange, M3U8Parser, Media, Resolution, Segment, StreamInfo, load
from tests.resources import text from tests.resources import text

View File

@ -2,7 +2,7 @@ import unittest
from threading import Event from threading import Event
from unittest.mock import Mock, call, patch from unittest.mock import Mock, call, patch
from websocket import ABNF, STATUS_NORMAL from websocket import ABNF, STATUS_NORMAL # type: ignore[import]
from streamlink.logger import DEBUG, TRACE from streamlink.logger import DEBUG, TRACE
from streamlink.plugin.api.websocket import WebsocketClient from streamlink.plugin.api.websocket import WebsocketClient