Closed tomaszmrugalski closed 4 years ago
TypedDict (and Literal) is a part of Python from 3.8 version.
Previously it was a part of MyPy extensions typing_extensions. We can import TypedDict from this package when we recognize that Python version is less then 3.8.
We need to analyze which versions of Python we want to support. The content server uses Python 3.8, but Raspberry Pi uses 3.7 (latest version in stable Debian repo).
MyPy documentation recommend using typing_extensions for TypedDict and Literal.
if sys.version_info[0] == 3 and sys.version_info[1] >= 8:
from typing import TypedDict, Literal
else:
from typing_extensions import TypedDict, Literal
I think it's time to fix the travis CI tests and start paying attention to their status. It would have been picked by travis (builds on python 3.6, 3.7 and 3.8), but we didn't have the postgres setup completed there. I try to fix that.
This has been fixed with #40 merge.
Try to Uninstall the related librarie(s) and install it again. it worked for me.
The recent change in backend/app/repository.py imports TypedDict from typing. Unfortunately, on python 3.7.5 it does fails:
See https://docs.python.org/3.7/library/typing.html and https://docs.python.org/3.8/library/typing.html