From 9d82f9b9c92d6340c9fe56df3f6d0be8222cf45b Mon Sep 17 00:00:00 2001 From: Xavier Olive Date: Tue, 1 Nov 2022 20:38:29 +0900 Subject: [PATCH] compatibility with Python 3.7 --- pyModeS/decoder/uncertainty.py | 7 ++++++- setup.py | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/pyModeS/decoder/uncertainty.py b/pyModeS/decoder/uncertainty.py index 122603a..00cf350 100644 --- a/pyModeS/decoder/uncertainty.py +++ b/pyModeS/decoder/uncertainty.py @@ -4,7 +4,12 @@ from __future__ import annotations -from typing import TypedDict +import sys + +if sys.version_info < (3, 8): + from typing_extensions import TypedDict +else: + from typing import TypedDict NA = None diff --git a/setup.py b/setup.py index f977af5..172cc0b 100644 --- a/setup.py +++ b/setup.py @@ -43,7 +43,8 @@ details = dict( ], keywords="Mode-S ADS-B EHS ELS Comm-B", packages=find_packages(exclude=["contrib", "docs", "tests"]), - install_requires=["numpy", "pyzmq"], + # typing_extensions are no longer necessary after Python 3.8 (TypedDict) + install_requires=["numpy", "pyzmq", "typing_extensions"], extras_require={"fast": ["Cython"]}, package_data={"pyModeS": ["*.pyx", "*.pxd", "py.typed"]}, scripts=["pyModeS/streamer/modeslive"],