Skip to content

Commit f4b97dc

Browse files
authored
Merge pull request #137 from yukinarit/bump-to-0.4.0
chore: Bump version to 0.4.0
2 parents 1188525 + a385b8a commit f4b97dc

File tree

2 files changed

+66
-1
lines changed

2 files changed

+66
-1
lines changed

CHANGELOG.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,68 @@
1+
## `0.4.0` (2021-06-17)
2+
3+
* feat: add support for lazy annotations PEP563 (#112) ([f7f6996](https://github.com/yukinarit/pyserde/commit/f7f6996)), closes [#112](https://github.com/yukinarit/pyserde/issues/112)
4+
5+
```python
6+
from __future__ import annotations
7+
from dataclasses import dataclass
8+
from serde import deserialize, serialize
9+
10+
@deserialize
11+
@serialize
12+
@dataclass
13+
class Foo:
14+
i: int
15+
s: str
16+
f: float
17+
b: bool
18+
19+
def foo(self, cls: Foo): # You can use "Foo" type before it's defined.
20+
print('foo')
21+
```
22+
23+
* feat: Implement custom class (de)serializer ([3484d46](https://github.com/yukinarit/pyserde/commit/3484d46))
24+
* feat: Implement custom field (de)serializer ([14b791c](https://github.com/yukinarit/pyserde/commit/14b791c))
25+
26+
```python
27+
def serializer(cls, o):
28+
...
29+
30+
def deserializer(cls, o):
31+
...
32+
33+
@deserialize(deserializer=deserializer)
34+
@serialize(serializer=serializer)
35+
@dataclass
36+
class Foo:
37+
i: int
38+
# Class serializer/deserializer is used as default.
39+
dt1: datetime
40+
# Override by field serializer/deserializer.
41+
dt2: datetime = field(
42+
metadata={
43+
'serde_serializer': lambda x: x.strftime('%y.%m.%d'),
44+
'serde_deserializer': lambda x: datetime.strptime(x, '%y.%m.%d'),
45+
}
46+
)
47+
```
48+
49+
* feat: Improve error description for union type ([8abb549](https://github.com/yukinarit/pyserde/commit/8abb549))
50+
* feat: Improve serde.inspect ([8b8635a](https://github.com/yukinarit/pyserde/commit/8b8635a))
51+
* feat: Support typing.any ([988a621](https://github.com/yukinarit/pyserde/commit/988a621))
52+
* feat: Support typing.NewType for primitives ([731ed79](https://github.com/yukinarit/pyserde/commit/731ed79))
53+
* refactor: Add lvalue renderer for serialization ([665dc77](https://github.com/yukinarit/pyserde/commit/665dc77))
54+
* refactor: Remove arg template filter from se.py ([0377655](https://github.com/yukinarit/pyserde/commit/0377655))
55+
* refactor: Remove self class from scope ([da81f1f](https://github.com/yukinarit/pyserde/commit/da81f1f))
56+
* refactor: Rename custom (de)serializer attributes ([03b2274](https://github.com/yukinarit/pyserde/commit/03b2274))
57+
* ci: Add python 3.10-dev to CI pipeline ([1f33e59](https://github.com/yukinarit/pyserde/commit/1f33e59))
58+
* ci: Don't cache pip to workaround pip error ([c912429](https://github.com/yukinarit/pyserde/commit/c912429))
59+
* build: add pre-commit to test requirements ([a88ea40](https://github.com/yukinarit/pyserde/commit/a88ea40))
60+
* fix: correctly render single element tuples ([a8a6456](https://github.com/yukinarit/pyserde/commit/a8a6456))
61+
* fix: pass convert_sets argument to union functions ([ab40cc9](https://github.com/yukinarit/pyserde/commit/ab40cc9))
62+
* fix: support unions with nested unions in containers (#113) ([c26e828](https://github.com/yukinarit/pyserde/commit/c26e828)), closes [#113](https://github.com/yukinarit/pyserde/issues/113)
63+
64+
This release had contibutions from 1 person: [@ydylla](https://github.com/ydylla). Thank you so much! :tada: :joy:
65+
166
## `0.3.2` (2021-05-07)
267

368
* feat: Improve error description for union type ([8abb549](https://github.com/yukinarit/pyserde/commit/8abb549))

serde/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
from .se import asdict, astuple, default_serializer, is_serializable, serialize, to_dict, to_tuple # noqa
99

1010
""" Version of pyserde. """
11-
__version__ = '0.3.2'
11+
__version__ = '0.4.0'
1212

1313
__all__ = [
1414
'serialize',

0 commit comments

Comments
 (0)