summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDevaev Maxim <[email protected]>2020-12-02 14:37:48 +0300
committerDevaev Maxim <[email protected]>2020-12-02 14:37:48 +0300
commit2b064a3bee87a13930e1212b583278ff2a8117db (patch)
tree13aec1649cdda610c3e293386a41698eaaa3ff00
parent9dbf7f1d0ba5639ec5a4a699213660d72a3ba1c4 (diff)
basic python 3.9 support
-rw-r--r--kvmd/aiotools.py2
-rw-r--r--kvmd/apps/kvmd/api/auth.py2
-rw-r--r--kvmd/apps/kvmd/server.py2
-rw-r--r--kvmd/apps/kvmd/streamer.py2
-rw-r--r--kvmd/apps/vnc/server.py2
-rwxr-xr-xsetup.py1
-rw-r--r--testenv/linters/mypy.ini2
-rw-r--r--testenv/linters/pylint.ini2
-rw-r--r--testenv/tox.ini2
9 files changed, 10 insertions, 7 deletions
diff --git a/kvmd/aiotools.py b/kvmd/aiotools.py
index b5d9e2fd..dd22b6c5 100644
--- a/kvmd/aiotools.py
+++ b/kvmd/aiotools.py
@@ -65,7 +65,7 @@ def create_short_task(coro: Coroutine) -> asyncio.Task:
def get_short_tasks() -> List[asyncio.Task]:
return [
task
- for task in asyncio.Task.all_tasks()
+ for task in asyncio.all_tasks()
if getattr(task, _ATTR_SHORT_TASK, False)
]
diff --git a/kvmd/apps/kvmd/api/auth.py b/kvmd/apps/kvmd/api/auth.py
index 15c01060..fcd68dfe 100644
--- a/kvmd/apps/kvmd/api/auth.py
+++ b/kvmd/apps/kvmd/api/auth.py
@@ -56,7 +56,7 @@ async def check_request_auth(auth_manager: AuthManager, exposed: HttpExposed, re
token = request.cookies.get(_COOKIE_AUTH_TOKEN, "")
if token:
- user = auth_manager.check(valid_auth_token(token))
+ user = auth_manager.check(valid_auth_token(token)) # type: ignore
if not user:
set_request_auth_info(request, "- (token)")
raise ForbiddenError()
diff --git a/kvmd/apps/kvmd/server.py b/kvmd/apps/kvmd/server.py
index fee4b30a..67d1e70c 100644
--- a/kvmd/apps/kvmd/server.py
+++ b/kvmd/apps/kvmd/server.py
@@ -226,7 +226,7 @@ class KvmdServer(HttpServer): # pylint: disable=too-many-arguments,too-many-ins
if name not in current_params:
assert exc_cls is not None, name
raise exc_cls()
- value = validator(value)
+ value = validator(value) # type: ignore
if current_params[name] != value:
self.__new_streamer_params[name] = value
await self.__streamer_notifier.notify()
diff --git a/kvmd/apps/kvmd/streamer.py b/kvmd/apps/kvmd/streamer.py
index 047e4c97..85107edd 100644
--- a/kvmd/apps/kvmd/streamer.py
+++ b/kvmd/apps/kvmd/streamer.py
@@ -308,7 +308,7 @@ class Streamer: # pylint: disable=too-many-instance-attributes
mtime=float(response.headers["X-Timestamp"]),
headers=tuple(
(key, value)
- for (key, value) in tools.sorted_kvs(response.headers)
+ for (key, value) in tools.sorted_kvs(dict(response.headers))
if key.lower().startswith("x-ustreamer-") or key.lower() in [
"x-timestamp",
"access-control-allow-origin",
diff --git a/kvmd/apps/vnc/server.py b/kvmd/apps/vnc/server.py
index d871ec3e..ece2fcea 100644
--- a/kvmd/apps/vnc/server.py
+++ b/kvmd/apps/vnc/server.py
@@ -435,7 +435,7 @@ class VncServer: # pylint: disable=too-many-instance-attributes
server.close()
loop.run_until_complete(server.wait_closed())
finally:
- tasks = asyncio.Task.all_tasks()
+ tasks = asyncio.all_tasks(loop)
for task in tasks:
task.cancel()
loop.run_until_complete(asyncio.gather(*tasks, return_exceptions=True))
diff --git a/setup.py b/setup.py
index 47432e80..acf337a9 100755
--- a/setup.py
+++ b/setup.py
@@ -141,6 +141,7 @@ def main() -> None:
"Development Status :: 4 - Beta",
"Programming Language :: Python :: 3.7",
"Programming Language :: Python :: 3.8",
+ "Programming Language :: Python :: 3.9",
"Topic :: System :: Systems Administration",
"Operating System :: POSIX :: Linux",
"Intended Audience :: System Administrators",
diff --git a/testenv/linters/mypy.ini b/testenv/linters/mypy.ini
index a48e58e7..00dd6881 100644
--- a/testenv/linters/mypy.ini
+++ b/testenv/linters/mypy.ini
@@ -1,5 +1,5 @@
[mypy]
-python_version = 3.8
+python_version = 3.9
ignore_missing_imports = true
disallow_untyped_defs = true
strict_optional = true
diff --git a/testenv/linters/pylint.ini b/testenv/linters/pylint.ini
index dff276c6..b2471ffe 100644
--- a/testenv/linters/pylint.ini
+++ b/testenv/linters/pylint.ini
@@ -34,6 +34,8 @@ disable =
len-as-condition,
raise-missing-from,
consider-using-in,
+ unsubscriptable-object,
+# https://github.com/PyCQA/pylint/issues/3882
[CLASSES]
exclude-protected =
diff --git a/testenv/tox.ini b/testenv/tox.ini
index 2da66b1d..ba50e422 100644
--- a/testenv/tox.ini
+++ b/testenv/tox.ini
@@ -3,7 +3,7 @@ envlist = flake8, pylint, mypy, vulture, pytest, eslint, htmlhint
skipsdist = true
[testenv]
-basepython = python3.8
+basepython = python3.9
sitepackages = true
changedir = /src