fix python 3.7 compatability
authorMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 25 Nov 2020 07:24:58 +0000 (08:24 +0100)
committerMarcel van der Veldt <m.vanderveldt@outlook.com>
Wed, 25 Nov 2020 07:24:58 +0000 (08:24 +0100)
music_assistant/constants.py
music_assistant/helpers/web.py
requirements.txt

index 30028815b8aab94ba167e431879f1b0d649b629d..c4f10c7fd566e2c0f9a4cb2dfdcc7e69fd9920ff 100755 (executable)
@@ -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"
index 77dae2b79d7e19f553e2410ced0c9bb42e49d199..056f0aaf949c2876d7469cb498895c50af4d18d2 100644 (file)
@@ -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."""
index eb4d649a78a1d64a9b2fe0a28df7c559c1900ff0..26f933b859dc96fc8cba81213e1a5c71bb6277ca 100644 (file)
@@ -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'