Skip to content

Commit

Permalink
Fix for import of TypedDict for Python versions older than 3.8 (#373)
Browse files Browse the repository at this point in the history
* Fixed import of TypedDict for older Python versions

* Updated changelog for 0.2.6 release
  • Loading branch information
sigurdp authored Jan 7, 2021
1 parent ca9c273 commit f6645ad
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 10 deletions.
11 changes: 10 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,18 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [UNRELEASED] - YYYY-MM-DD

## [0.2.6] - 2021-01-07

### Fixed
- [#373](https://github.com/equinor/webviz-config/pull/373) - Fix for import of TypedDict
in Python versions older than 3.8. Check against Python version instead of using try-except.

## [0.2.5] - 2020-12-19

### Changed
- [#367](https://github.com/equinor/webviz-config/pull/367) - Made type information
available to package consumers by indicating support for typing as specified in [PEP 561](https://www.python.org/dev/peps/pep-0561/).
available to package consumers by indicating support for typing as specified in
[PEP 561](https://www.python.org/dev/peps/pep-0561/).

## [0.2.4] - 2020-12-08

Expand Down
15 changes: 6 additions & 9 deletions webviz_config/_plugin_abc.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,18 +3,15 @@
import base64
import zipfile
import warnings

import sys
from uuid import uuid4
from typing import List, Optional, Type, Union

try:
# Python 3.8+
# pylint: disable=ungrouped-imports
from typing import TypedDict # type: ignore
except (ImportError, ModuleNotFoundError):
# Python < 3.8
from typing_extensions import TypedDict # type: ignore

# pylint: disable=wrong-import-position
if sys.version_info >= (3, 8):
from typing import TypedDict
else:
from typing_extensions import TypedDict

import bleach
from dash.development.base_component import Component
Expand Down

0 comments on commit f6645ad

Please sign in to comment.