Merge pull request #5131 from freqtrade/dependabot/pip/develop/mypy-0.902

Bump mypy from 0.812 to 0.902
This commit is contained in:
Matthias 2021-06-14 19:03:46 +01:00 committed by GitHub
commit 0af9bcef60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 17 additions and 9 deletions

View File

@ -58,6 +58,9 @@ class IResolver:
# Generate spec based on absolute path
# Pass object_name as first argument to have logging print a reasonable name.
spec = importlib.util.spec_from_file_location(object_name or "", str(module_path))
if not spec:
return iter([None])
module = importlib.util.module_from_spec(spec)
try:
spec.loader.exec_module(module) # type: ignore # importlib does not use typehints

View File

@ -77,14 +77,13 @@ class Webhook(RPCHandler):
def _send_msg(self, payload: dict) -> None:
"""do the actual call to the webhook"""
if self._format == 'form':
kwargs = {'data': payload}
elif self._format == 'json':
kwargs = {'json': payload}
else:
raise NotImplementedError('Unknown format: {}'.format(self._format))
try:
post(self._url, **kwargs)
if self._format == 'form':
post(self._url, data=payload)
elif self._format == 'json':
post(self._url, json=payload)
else:
raise NotImplementedError('Unknown format: {}'.format(self._format))
except RequestException as exc:
logger.warning("Could not call webhook url. Exception: %s", exc)

View File

@ -7,7 +7,7 @@ coveralls==3.1.0
flake8==3.9.2
flake8-type-annotations==0.1.0
flake8-tidy-imports==4.3.0
mypy==0.812
mypy==0.902
pytest==6.2.4
pytest-asyncio==0.15.1
pytest-cov==2.12.1
@ -17,3 +17,9 @@ isort==5.8.0
# Convert jupyter notebooks to markdown documents
nbconvert==6.0.7
# mypy types
types-cachetools==0.1.7
types-filelock==0.1.3
types-requests==0.1.11
types-tabulate==0.1.0