From 8d710a36cf0e71d9b51b3d6b6eb197f303892900 Mon Sep 17 00:00:00 2001 From: Marcel van der Veldt Date: Wed, 25 Nov 2020 08:24:58 +0100 Subject: [PATCH] fix python 3.7 compatability --- music_assistant/constants.py | 4 ++-- music_assistant/helpers/web.py | 9 ++++++++- requirements.txt | 3 ++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/music_assistant/constants.py b/music_assistant/constants.py index 30028815..c4f10c7f 100755 --- a/music_assistant/constants.py +++ b/music_assistant/constants.py @@ -1,7 +1,7 @@ """All constants for Music Assistant.""" -__version__ = "0.0.68" -REQUIRED_PYTHON_VER = "3.8" +__version__ = "0.0.69" +REQUIRED_PYTHON_VER = "3.7" # configuration keys/attributes CONF_USERNAME = "username" diff --git a/music_assistant/helpers/web.py b/music_assistant/helpers/web.py index 77dae2b7..056f0aaf 100644 --- a/music_assistant/helpers/web.py +++ b/music_assistant/helpers/web.py @@ -5,11 +5,18 @@ import inspect import ipaddress from datetime import datetime from functools import wraps -from typing import Any, Callable, Union, get_args, get_origin +from typing import Any, Callable, Union import ujson from aiohttp import web +try: + # python 3.8+ + from typing import get_args, get_origin +except ImportError: + # python 3.7 + from typing_inspect import get_args, get_origin + def require_local_subnet(func): """Return decorator to specify web method as available locally only.""" diff --git a/requirements.txt b/requirements.txt index eb4d649a..26f933b8 100644 --- a/requirements.txt +++ b/requirements.txt @@ -19,4 +19,5 @@ passlib==1.7.4 cryptography==3.2.1 ujson==4.0.1 mashumaro==1.15 - +typing-inspect==0.6.0; python_version < '3.8' +uvloop==0.14.0; sys_platform != 'win32' -- 2.34.1