diff --git a/RELEASES.rst b/RELEASES.rst index 2d34181..ee4005b 100644 --- a/RELEASES.rst +++ b/RELEASES.rst @@ -1,6 +1,19 @@ Releases ======== +0.4.1 +----- + +*Unreleased* + +- Use 'simplejson' package if available. (`#60`_, `#63`_) +- Fix a bug where Choice Field didn't call super().validate(). (`#62`_) + +.. _#63: /~https://github.com/rossmacarthur/serde/pull/63 +.. _#62: /~https://github.com/rossmacarthur/serde/pull/62 + +.. _#60: /~https://github.com/rossmacarthur/serde/issues/60 + 0.4.0 ----- diff --git a/setup.py b/setup.py index 77fdf6d..49cb4d2 100644 --- a/setup.py +++ b/setup.py @@ -40,6 +40,9 @@ def get_metadata(): 'six >=1.0.0, <2.0.0', 'validators >=0.12.0, <0.13.0' ] +json_requires = [ + 'simplejson >=3.0.0, <4.0.0' +] toml_requires = [ 'toml >=0.10.0, <0.11.0' ] @@ -67,6 +70,7 @@ def get_metadata(): # Options install_requires=install_requires, extras_require={ + 'json': json_requires, 'toml': toml_requires, 'yaml': yaml_requires, 'dev.lint': lint_requires, diff --git a/src/serde/model.py b/src/serde/model.py index 3dcb82e..d2bab50 100644 --- a/src/serde/model.py +++ b/src/serde/model.py @@ -69,7 +69,6 @@ """ -import json from collections import OrderedDict from contextlib import contextmanager from functools import wraps @@ -84,6 +83,11 @@ from serde.utils import dict_partition, try_import, zip_until_right +try: + import simplejson as json +except ImportError: + import json + toml = try_import('toml') yaml = try_import('ruamel.yaml')