fix(registry): use TypedDict when python version >= 3.8, otherwise a Dict
- TypedDict is provided by the typing module for python >= 3.8 - TypedDict is provided by the typing_extensions module for typing_extensions >= 3.7.4 but this module is not available as debian buster package. - mypy does not support condition types defined like that: ``` if CONDITION: type = Dict else: type = TypedDict ``` and therefore it's not possible to conditionally declare the type. but… it does support checks with python version or system platform (cf: https://mypy.readthedocs.io/en/stable/common_issues.html#python-version-and-system-platform-checks). Let's import TypedDict from typing when it's available (python >= 3.8), and use it. Otherwise, let's use a simple dict. related #9
Status | Name | Job ID | Coverage | ||||||
---|---|---|---|---|---|---|---|---|---|
Tests | |||||||||
passed | black |
#117463
|
00:00:44
|
|
|||||
passed | check-manifest |
#117462
|
00:00:42
|
|
|||||
passed | flake8 |
#117461
|
00:00:47
|
|
|||||
passed | mypy |
#117464
|
00:01:03
|
|
|||||
passed | py3 |
#117460
|
00:00:52
|
|
|||||
After Tests | |||||||||
passed | trigger-cubicweb-pipeline |
#117465
bridge
|
|
||||||
passed | trigger-logilab-constraint-pipeline |
#117469
bridge
|
|
||||||
passed | trigger-logilab-database-pipeline |
#117468
bridge
|
|
||||||
passed | trigger-logilab-mtconverter-pipeline |
#117470
bridge
|
|
||||||
passed | trigger-rql-pipeline |
#117467
bridge
|
|
||||||
passed | trigger-yams-pipeline |
#117466
bridge
|
|
||||||