|
| 1 | +## v1.7 (2020-10-26) |
| 2 | + |
| 3 | +Thank you to pydantic's sponsors: |
| 4 | +@timdrijvers, @BCarley, @chdsbd, @tiangolo, @matin, @linusg, @kevinalh, @jorgecarleitao, @koxudaxi, @primer-api |
| 5 | +for their kind support. |
| 6 | + |
| 7 | +### Highlights |
| 8 | + |
| 9 | +* python 3.9 support, thanks @PrettyWood |
| 10 | +* [Private model attributes](https://pydantic-docs.helpmanual.io/usage/models/#private-model-attributes), thanks @MrMrRobat |
| 11 | +* ["secrets files" support in `BaseSettings`](https://pydantic-docs.helpmanual.io/usage/settings/#secret-support), thanks @mdgilene |
| 12 | +* [convert stdlib dataclasses to pydantic dataclasses and use stdlib dataclasses in models](https://pydantic-docs.helpmanual.io/usage/dataclasses/#stdlib-dataclasses-and-pydantic-dataclasses), thanks @PrettyWood |
| 13 | + |
| 14 | +### Changes |
| 15 | + |
| 16 | +* **Breaking Change:** remove `__field_defaults__`, add `default_factory` support with `BaseModel.construct`. |
| 17 | + Use `.get_default()` method on fields in `__fields__` attribute instead, #1732 by @PrettyWood |
| 18 | +* Rearrange CI to run linting as a separate job, split install recipes for different tasks, #2020 by @samuelcolvin |
| 19 | +* Allows subclasses of generic models to make some, or all, of the superclass's type parameters concrete, while |
| 20 | + also defining new type parameters in the subclass, #2005 by @choogeboom |
| 21 | +* Call validator with the correct `values` parameter type in `BaseModel.__setattr__`, |
| 22 | + when `validate_assignment = True` in model config, #1999 by @me-ransh |
| 23 | +* Force `fields.Undefined` to be a singleton object, fixing inherited generic model schemas, #1981 by @daviskirk |
| 24 | +* Include tests in source distributions, #1976 by @sbraz |
| 25 | +* Add ability to use `min_length/max_length` constraints with secret types, #1974 by @uriyyo |
| 26 | +* Also check `root_validators` when `validate_assignment` is on, #1971 by @PrettyWood |
| 27 | +* Fix const validators not running when custom validators are present, #1957 by @hmvp |
| 28 | +* add `deque` to field types, #1935 by @wozniakty |
| 29 | +* add basic support for python 3.9, #1832 by @PrettyWood |
| 30 | +* Fix typo in the anchor of exporting_models.md#modelcopy and incorrect description, #1821 by @KimMachineGun |
| 31 | +* Added ability for `BaseSettings` to read "secret files", #1820 by @mdgilene |
| 32 | +* add `parse_raw_as` utility function, #1812 by @PrettyWood |
| 33 | +* Support home directory relative paths for `dotenv` files (e.g. `~/.env`), #1803 by @PrettyWood |
| 34 | +* Clarify documentation for `parse_file` to show that the argument |
| 35 | + should be a file *path* not a file-like object, #1794 by @mdavis-xyz |
| 36 | +* Fix false positive from mypy plugin when a class nested within a `BaseModel` is named `Model`, #1770 by @selimb |
| 37 | +* add basic support of Pattern type in schema generation, #1767 by @PrettyWood |
| 38 | +* Support custom title, description and default in schema of enums, #1748 by @PrettyWood |
| 39 | +* Properly represent `Literal` Enums when `use_enum_values` is True, #1747 by @noelevans |
| 40 | +* Allows timezone information to be added to strings to be formatted as time objects. Permitted formats are `Z` for UTC |
| 41 | + or an offset for absolute positive or negative time shifts. Or the timezone data can be omitted, #1744 by @noelevans |
| 42 | +* Add stub `__init__` with python 3.6 signature for `ForwardRef`, #1738 by @sirtelemak |
| 43 | +* Fix behaviour with forward refs and optional fields in nested models, #1736 by @PrettyWood |
| 44 | +* add `Enum` and `IntEnum` as valid types for fields, #1735 by @PrettyWood |
| 45 | +* Change default value of `__module__` argument of `create_model` from `None` to `'pydantic.main'`. |
| 46 | + Set reference of created concrete model to it's module to allow pickling (not applied to models created in |
| 47 | + functions), #1686 by @MrMrRobat |
| 48 | +* Add private attributes support, #1679 by @MrMrRobat |
| 49 | +* add `config` to `@validate_arguments`, #1663 by @samuelcolvin |
| 50 | +* Allow descendant Settings models to override env variable names for the fields defined in parent Settings models with |
| 51 | + `env` in their `Config`. Previously only `env_prefix` configuration option was applicable, #1561 by @ojomio |
| 52 | +* Support `ref_template` when creating schema `$ref`s, #1479 by @kilo59 |
| 53 | +* Add a `__call__` stub to `PyObject` so that mypy will know that it is callable, #1352 by @brianmaissy |
| 54 | +* `pydantic.dataclasses.dataclass` decorator now supports built-in `dataclasses.dataclass`. |
| 55 | + It is hence possible to convert an existing `dataclass` easily to add *pydantic* validation. |
| 56 | + Moreover nested dataclasses are also supported, #744 by @PrettyWood |
| 57 | + |
1 | 58 | ## v1.6.1 (2020-07-15) |
2 | 59 |
|
3 | 60 | * fix validation and parsing of nested models with `default_factory`, #1710 by @PrettyWood |
|
0 commit comments