mirror of
https://github.com/Grasscutters/mitmproxy.git
synced 2024-11-22 07:08:10 +00:00
update mypy
This commit is contained in:
parent
8cec4a2a80
commit
bed008e6d1
@ -29,6 +29,7 @@ def load_script(path: str) -> typing.Optional[types.ModuleType]:
|
|||||||
try:
|
try:
|
||||||
loader = importlib.machinery.SourceFileLoader(fullname, path)
|
loader = importlib.machinery.SourceFileLoader(fullname, path)
|
||||||
spec = importlib.util.spec_from_loader(fullname, loader=loader)
|
spec = importlib.util.spec_from_loader(fullname, loader=loader)
|
||||||
|
assert spec
|
||||||
m = importlib.util.module_from_spec(spec)
|
m = importlib.util.module_from_spec(spec)
|
||||||
loader.exec_module(m)
|
loader.exec_module(m)
|
||||||
if not getattr(m, "name", None):
|
if not getattr(m, "name", None):
|
||||||
|
@ -17,6 +17,12 @@ import collections.abc
|
|||||||
import pydivert
|
import pydivert
|
||||||
import pydivert.consts
|
import pydivert.consts
|
||||||
|
|
||||||
|
if typing.TYPE_CHECKING:
|
||||||
|
class WindowsError(OSError):
|
||||||
|
@property
|
||||||
|
def winerror(self) -> int:
|
||||||
|
return 42
|
||||||
|
|
||||||
REDIRECT_API_HOST = "127.0.0.1"
|
REDIRECT_API_HOST = "127.0.0.1"
|
||||||
REDIRECT_API_PORT = 8085
|
REDIRECT_API_PORT = 8085
|
||||||
|
|
||||||
|
9
tox.ini
9
tox.ini
@ -28,7 +28,14 @@ commands =
|
|||||||
python ./test/filename_matching.py
|
python ./test/filename_matching.py
|
||||||
|
|
||||||
[testenv:mypy]
|
[testenv:mypy]
|
||||||
deps = mypy==0.812
|
deps =
|
||||||
|
mypy==0.902
|
||||||
|
types-certifi==0.1.3
|
||||||
|
types-Flask==1.1.0
|
||||||
|
types-Werkzeug==1.0.1
|
||||||
|
types-requests==0.1.11
|
||||||
|
types-cryptography==3.3.2
|
||||||
|
|
||||||
commands =
|
commands =
|
||||||
mypy {posargs}
|
mypy {posargs}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user