From 8dabb34390a11bc424941fea194a3c524e1402b6 Mon Sep 17 00:00:00 2001 From: Samuel Colvin Date: Tue, 1 Oct 2019 17:41:33 +0100 Subject: [PATCH] Version 1 beta (#853) * link to old docs, uprev * generate history --- HISTORY.rst | 49 +++++++++++++++++++++++++++++++ changes/577-samuelcolvin.rst | 1 - changes/617-dmontagu.rst | 1 - changes/653-abdusco.rst | 1 - changes/710-maddosaurus.rst | 1 - changes/714-samuelcolvin.rst | 1 - changes/715-dmontagu.rst | 1 - changes/720-samuelcolvin.rst | 2 -- changes/721-dmontagu.rst | 2 -- changes/729-samuelcolvin.rst | 1 - changes/733-samuelcolvin.rst | 2 -- changes/735-dmontagu.rst | 1 - changes/738-samuelcolvin.rst | 1 - changes/745-djpetti.rst | 1 - changes/748-Raphael-C-Almeida.rst | 1 - changes/750-koxudaxi.rst | 1 - changes/752-dmontagu.rst | 1 - changes/753-dmontagu.rst | 1 - changes/755-samuelcolvin.rst | 1 - changes/757-dmontagu.rst | 1 - changes/761-samuelcolvin.rst | 1 - changes/763-samuelcolvin.rst | 1 - changes/766-samuelcolvin.rst | 2 -- changes/770-dmontagu.rst | 1 - changes/772-skewty.rst | 1 - changes/783-samuelcolvin.rst | 1 - changes/790-matin.rst | 1 - changes/794-hmvp.rst | 1 - changes/796-Code0x58.rst | 1 - changes/798-henriklindgren.rst | 1 - changes/799-DerRidda.rst | 2 -- changes/803-samuelcolvin.rst | 2 -- changes/807-timonbimon.rst | 1 - changes/819-samuelcolvin.rst | 1 - changes/820-dmontagu.rst | 1 - changes/821-samuelcolvin.rst | 1 - changes/842-zpencerq.rst | 1 - changes/847-samuelcolvin.rst | 2 -- changes/851-samuelcolvin.rst | 2 -- docs/index.rst | 5 ++++ pydantic/version.py | 2 +- 41 files changed, 55 insertions(+), 47 deletions(-) delete mode 100644 changes/577-samuelcolvin.rst delete mode 100644 changes/617-dmontagu.rst delete mode 100644 changes/653-abdusco.rst delete mode 100644 changes/710-maddosaurus.rst delete mode 100644 changes/714-samuelcolvin.rst delete mode 100644 changes/715-dmontagu.rst delete mode 100644 changes/720-samuelcolvin.rst delete mode 100644 changes/721-dmontagu.rst delete mode 100644 changes/729-samuelcolvin.rst delete mode 100644 changes/733-samuelcolvin.rst delete mode 100644 changes/735-dmontagu.rst delete mode 100644 changes/738-samuelcolvin.rst delete mode 100644 changes/745-djpetti.rst delete mode 100644 changes/748-Raphael-C-Almeida.rst delete mode 100644 changes/750-koxudaxi.rst delete mode 100644 changes/752-dmontagu.rst delete mode 100644 changes/753-dmontagu.rst delete mode 100644 changes/755-samuelcolvin.rst delete mode 100644 changes/757-dmontagu.rst delete mode 100644 changes/761-samuelcolvin.rst delete mode 100644 changes/763-samuelcolvin.rst delete mode 100644 changes/766-samuelcolvin.rst delete mode 100644 changes/770-dmontagu.rst delete mode 100644 changes/772-skewty.rst delete mode 100644 changes/783-samuelcolvin.rst delete mode 100644 changes/790-matin.rst delete mode 100644 changes/794-hmvp.rst delete mode 100644 changes/796-Code0x58.rst delete mode 100644 changes/798-henriklindgren.rst delete mode 100644 changes/799-DerRidda.rst delete mode 100644 changes/803-samuelcolvin.rst delete mode 100644 changes/807-timonbimon.rst delete mode 100644 changes/819-samuelcolvin.rst delete mode 100644 changes/820-dmontagu.rst delete mode 100644 changes/821-samuelcolvin.rst delete mode 100644 changes/842-zpencerq.rst delete mode 100644 changes/847-samuelcolvin.rst delete mode 100644 changes/851-samuelcolvin.rst diff --git a/HISTORY.rst b/HISTORY.rst index 7632f8a..82014e3 100644 --- a/HISTORY.rst +++ b/HISTORY.rst @@ -3,6 +3,55 @@ History ------- +v1.0b1 (2019-10-01) +................... +* **Breaking Change:** rename ``Schema`` to ``Field``, make it a function to placate mypy, #577 by @samuelcolvin +* **Breaking Change:** modify parsing behavior for ``bool``, #617 by @dmontagu +* **Breaking Change:** ``get_validators`` is no longer recognised, use ``__get_validators__``. + ``Config.ignore_extra`` and ``Config.allow_extra`` are no longer recognised, use ``Config.extra``, #720 by @samuelcolvin +* **Breaking Change:** modify default config settings for ``BaseSettings``; ``case_insensitive`` renamed to ``case_sensitive``, + default changed to ``case_sensitive = False``, ``env_prefix`` default changed to ``''`` - e.g. no prefix, #721 by @dmontagu +* **Breaking change:** Implement ``root_validator`` and rename root errors from ``__obj__`` to ``__root__``, #729 by @samuelcolvin +* **Breaking Change:** alter the behaviour of ``dict(model)`` so that sub-models are nolonger + converted to dictionaries, #733 by @samuelcolvin +* **Breaking change:** Added ``initvars`` support to ``post_init_post_parse``, #748 by @Raphael-C-Almeida +* **Breaking Change:** Make ``BaseModel.json()`` only serialize the ``__root__`` key for models with custom root, #752 by @dmontagu +* **Breaking Change:** complete rewrite of ``URL`` parsing logic, #755 by @samuelcolvin +* **Breaking Change:** preserve superclass annotations for field-determination when not provided in subclass, #757 by @dmontagu +* **Breaking Change:** ``BaseSettings`` now uses the special ``env`` settings to define which environment variables to + read, not aliases, #847 by @samuelcolvin +* add support for ``assert`` statements inside validators, #653 by @abdusco +* Update documentation to specify the use of ``pydantic.dataclasses.dataclass`` and subclassing ``pydantic.BaseModel``, #710 by @maddosaurus +* Allow custom JSON decoding and encoding via ``json_loads`` and ``json_dumps`` ``Config`` properties, #714 by @samuelcolvin +* make all annotated fields occur in the order declared, #715 by @dmontagu +* use pytest to test ``mypy`` integration, #735 by @dmontagu +* add ``__repr__`` method to ``ErrorWrapper``, #738 by @samuelcolvin +* Added support for ``FrozenSet`` members in dataclasses, and a better error when attempting to use types from the ``typing`` module that are not supported by Pydantic, #745 by @djpetti +* add documentation for Pycharm Plugin, #750 by @koxudaxi +* fix broken examples in the docs, #753 by @dmontagu +* moving typing related objects into ``pydantic.typing``, #761 by @samuelcolvin +* Minor performance improvements to ``ErrorWrapper``, ``ValidationError`` and datetime parsing, #763 by @samuelcolvin +* Improvements to ``datetime``/``date``/``time``/``timedelta`` types: more descriptive errors, + change errors to ``value_error`` not ``type_error``, support bytes, #766 by @samuelcolvin +* fix error messages for ``Literal`` types with multiple allowed values, #770 by @dmontagu +* Improved auto-generated ``title`` field in JSON schema by converting underscore to space, #772 by @skewty +* support ``mypy --no-implicit-reexport`` for dataclasses, also respect ``--no-implicit-reexport`` in pydantic itself, #783 by @samuelcolvin +* add the ``PaymentCardNumber`` type, #790 by @matin +* Fix const validations for lists, #794 by @hmvp +* Set ``additionalProperties`` to false in schema for models with extra fields disallowed, #796 by @Code0x58 +* ``EmailStr`` validation method now returns local part case-sensitive per RFC 5321, #798 by @henriklindgren +* Added ability to validate strictness to ``ConstrainedFloat``, ``ConstrainedInt`` and ``ConstrainedStr`` and added + ``StrictFloat`` and ``StrictInt`` classes, #799 by @DerRidda +* Improve handling of ``None`` and ``Optional``, replace ``whole`` with ``each_item`` (inverse meaning, default ``False``) + on validators, #803 by @samuelcolvin +* add support for ``Type[T]`` type hints, #807 by @timonbimon +* Performance improvements from removing ``change_exceptions``, change how pydantic error are constructed, #819 by @samuelcolvin +* Fix the error message arising when a ``BaseModel``-type model field causes a ``ValidationError`` during parsing, #820 by @dmontagu +* allow ``getter_dict`` on ``Config``, modify ``GetterDict`` to be more like a ``Mapping`` object and thus easier to work with, #821 by @samuelcolvin +* Only check ``TypeVar`` param on base ``GenericModel`` class, #842 by @zpencerq +* rename ``Model._schema_cache`` -> ``Model.__schema_cache__``, ``Model._json_encoder`` -> ``Model.__json_encoder__``, + ``Model._custom_root_type`` -> ``Model.__custom_root_type__``, #851 by @samuelcolvin + v0.32.2 (2019-08-17) .................... * fix ``__post_init__`` usage with dataclass inheritance, fix #739 by @samuelcolvin diff --git a/changes/577-samuelcolvin.rst b/changes/577-samuelcolvin.rst deleted file mode 100644 index c2761ee..0000000 --- a/changes/577-samuelcolvin.rst +++ /dev/null @@ -1 +0,0 @@ -**Breaking Change:** rename ``Schema`` to ``Field``, make it a function to placate mypy diff --git a/changes/617-dmontagu.rst b/changes/617-dmontagu.rst deleted file mode 100644 index 8bc7c70..0000000 --- a/changes/617-dmontagu.rst +++ /dev/null @@ -1 +0,0 @@ -**Breaking Change:** modify parsing behavior for ``bool`` diff --git a/changes/653-abdusco.rst b/changes/653-abdusco.rst deleted file mode 100644 index a07d03b..0000000 --- a/changes/653-abdusco.rst +++ /dev/null @@ -1 +0,0 @@ -add support for ``assert`` statements inside validators \ No newline at end of file diff --git a/changes/710-maddosaurus.rst b/changes/710-maddosaurus.rst deleted file mode 100644 index 3ba98d4..0000000 --- a/changes/710-maddosaurus.rst +++ /dev/null @@ -1 +0,0 @@ -Update documentation to specify the use of ``pydantic.dataclasses.dataclass`` and subclassing ``pydantic.BaseModel``. diff --git a/changes/714-samuelcolvin.rst b/changes/714-samuelcolvin.rst deleted file mode 100644 index d28e90a..0000000 --- a/changes/714-samuelcolvin.rst +++ /dev/null @@ -1 +0,0 @@ -Allow custom JSON decoding and encoding via ``json_loads`` and ``json_dumps`` ``Config`` properties. diff --git a/changes/715-dmontagu.rst b/changes/715-dmontagu.rst deleted file mode 100644 index c4b90de..0000000 --- a/changes/715-dmontagu.rst +++ /dev/null @@ -1 +0,0 @@ -make all annotated fields occur in the order declared diff --git a/changes/720-samuelcolvin.rst b/changes/720-samuelcolvin.rst deleted file mode 100644 index 57c393c..0000000 --- a/changes/720-samuelcolvin.rst +++ /dev/null @@ -1,2 +0,0 @@ -**Breaking Change:** ``get_validators`` is no longer recognised, use ``__get_validators__``. -``Config.ignore_extra`` and ``Config.allow_extra`` are no longer recognised, use ``Config.extra``. diff --git a/changes/721-dmontagu.rst b/changes/721-dmontagu.rst deleted file mode 100644 index 94ada96..0000000 --- a/changes/721-dmontagu.rst +++ /dev/null @@ -1,2 +0,0 @@ -**Breaking Change:** modify default config settings for ``BaseSettings``; ``case_insensitive`` renamed to ``case_sensitive``, -default changed to ``case_sensitive = False``, ``env_prefix`` default changed to ``''`` - e.g. no prefix. diff --git a/changes/729-samuelcolvin.rst b/changes/729-samuelcolvin.rst deleted file mode 100644 index 9dc7d39..0000000 --- a/changes/729-samuelcolvin.rst +++ /dev/null @@ -1 +0,0 @@ -**Breaking change:** Implement ``root_validator`` and rename root errors from ``__obj__`` to ``__root__`` diff --git a/changes/733-samuelcolvin.rst b/changes/733-samuelcolvin.rst deleted file mode 100644 index 090fbe7..0000000 --- a/changes/733-samuelcolvin.rst +++ /dev/null @@ -1,2 +0,0 @@ -**Breaking Change:** alter the behaviour of ``dict(model)`` so that sub-models are nolonger -converted to dictionaries diff --git a/changes/735-dmontagu.rst b/changes/735-dmontagu.rst deleted file mode 100644 index 62b342d..0000000 --- a/changes/735-dmontagu.rst +++ /dev/null @@ -1 +0,0 @@ -use pytest to test ``mypy`` integration diff --git a/changes/738-samuelcolvin.rst b/changes/738-samuelcolvin.rst deleted file mode 100644 index af8154f..0000000 --- a/changes/738-samuelcolvin.rst +++ /dev/null @@ -1 +0,0 @@ -add ``__repr__`` method to ``ErrorWrapper`` diff --git a/changes/745-djpetti.rst b/changes/745-djpetti.rst deleted file mode 100644 index 592811b..0000000 --- a/changes/745-djpetti.rst +++ /dev/null @@ -1 +0,0 @@ -Added support for ``FrozenSet`` members in dataclasses, and a better error when attempting to use types from the ``typing`` module that are not supported by Pydantic. \ No newline at end of file diff --git a/changes/748-Raphael-C-Almeida.rst b/changes/748-Raphael-C-Almeida.rst deleted file mode 100644 index 727206f..0000000 --- a/changes/748-Raphael-C-Almeida.rst +++ /dev/null @@ -1 +0,0 @@ -**Breaking change:** Added ``initvars`` support to ``post_init_post_parse``. \ No newline at end of file diff --git a/changes/750-koxudaxi.rst b/changes/750-koxudaxi.rst deleted file mode 100644 index a63540c..0000000 --- a/changes/750-koxudaxi.rst +++ /dev/null @@ -1 +0,0 @@ -add documentation for Pycharm Plugin \ No newline at end of file diff --git a/changes/752-dmontagu.rst b/changes/752-dmontagu.rst deleted file mode 100644 index c15af68..0000000 --- a/changes/752-dmontagu.rst +++ /dev/null @@ -1 +0,0 @@ -**Breaking Change:** Make ``BaseModel.json()`` only serialize the ``__root__`` key for models with custom root diff --git a/changes/753-dmontagu.rst b/changes/753-dmontagu.rst deleted file mode 100644 index 44dc9b4..0000000 --- a/changes/753-dmontagu.rst +++ /dev/null @@ -1 +0,0 @@ -fix broken examples in the docs \ No newline at end of file diff --git a/changes/755-samuelcolvin.rst b/changes/755-samuelcolvin.rst deleted file mode 100644 index 26f3cc7..0000000 --- a/changes/755-samuelcolvin.rst +++ /dev/null @@ -1 +0,0 @@ -**Breaking Change:** complete rewrite of ``URL`` parsing logic diff --git a/changes/757-dmontagu.rst b/changes/757-dmontagu.rst deleted file mode 100644 index f6408ba..0000000 --- a/changes/757-dmontagu.rst +++ /dev/null @@ -1 +0,0 @@ -**Breaking Change:** preserve superclass annotations for field-determination when not provided in subclass \ No newline at end of file diff --git a/changes/761-samuelcolvin.rst b/changes/761-samuelcolvin.rst deleted file mode 100644 index a45bd5e..0000000 --- a/changes/761-samuelcolvin.rst +++ /dev/null @@ -1 +0,0 @@ -moving typing related objects into ``pydantic.typing``. diff --git a/changes/763-samuelcolvin.rst b/changes/763-samuelcolvin.rst deleted file mode 100644 index cc691bb..0000000 --- a/changes/763-samuelcolvin.rst +++ /dev/null @@ -1 +0,0 @@ -Minor performance improvements to ``ErrorWrapper``, ``ValidationError`` and datetime parsing. diff --git a/changes/766-samuelcolvin.rst b/changes/766-samuelcolvin.rst deleted file mode 100644 index a3dd299..0000000 --- a/changes/766-samuelcolvin.rst +++ /dev/null @@ -1,2 +0,0 @@ -Improvements to ``datetime``/``date``/``time``/``timedelta`` types: more descriptive errors, -change errors to ``value_error`` not ``type_error``, support bytes. diff --git a/changes/770-dmontagu.rst b/changes/770-dmontagu.rst deleted file mode 100644 index 1ee2864..0000000 --- a/changes/770-dmontagu.rst +++ /dev/null @@ -1 +0,0 @@ -fix error messages for ``Literal`` types with multiple allowed values diff --git a/changes/772-skewty.rst b/changes/772-skewty.rst deleted file mode 100644 index cebcde1..0000000 --- a/changes/772-skewty.rst +++ /dev/null @@ -1 +0,0 @@ -Improved auto-generated ``title`` field in JSON schema by converting underscore to space. \ No newline at end of file diff --git a/changes/783-samuelcolvin.rst b/changes/783-samuelcolvin.rst deleted file mode 100644 index 4d3f570..0000000 --- a/changes/783-samuelcolvin.rst +++ /dev/null @@ -1 +0,0 @@ -support ``mypy --no-implicit-reexport`` for dataclasses, also respect ``--no-implicit-reexport`` in pydantic itself. diff --git a/changes/790-matin.rst b/changes/790-matin.rst deleted file mode 100644 index c180627..0000000 --- a/changes/790-matin.rst +++ /dev/null @@ -1 +0,0 @@ -add the ``PaymentCardNumber`` type \ No newline at end of file diff --git a/changes/794-hmvp.rst b/changes/794-hmvp.rst deleted file mode 100644 index 0626c35..0000000 --- a/changes/794-hmvp.rst +++ /dev/null @@ -1 +0,0 @@ -Fix const validations for lists diff --git a/changes/796-Code0x58.rst b/changes/796-Code0x58.rst deleted file mode 100644 index 34ba928..0000000 --- a/changes/796-Code0x58.rst +++ /dev/null @@ -1 +0,0 @@ -Set ``additionalProperties`` to false in schema for models with extra fields disallowed. diff --git a/changes/798-henriklindgren.rst b/changes/798-henriklindgren.rst deleted file mode 100644 index b583102..0000000 --- a/changes/798-henriklindgren.rst +++ /dev/null @@ -1 +0,0 @@ -``EmailStr`` validation method now returns local part case-sensitive per RFC 5321. diff --git a/changes/799-DerRidda.rst b/changes/799-DerRidda.rst deleted file mode 100644 index d155610..0000000 --- a/changes/799-DerRidda.rst +++ /dev/null @@ -1,2 +0,0 @@ -Added ability to validate strictness to ``ConstrainedFloat``, ``ConstrainedInt`` and ``ConstrainedStr`` and added -``StrictFloat`` and ``StrictInt`` classes. diff --git a/changes/803-samuelcolvin.rst b/changes/803-samuelcolvin.rst deleted file mode 100644 index 76eda87..0000000 --- a/changes/803-samuelcolvin.rst +++ /dev/null @@ -1,2 +0,0 @@ -Improve handling of ``None`` and ``Optional``, replace ``whole`` with ``each_item`` (inverse meaning, default ``False``) -on validators. diff --git a/changes/807-timonbimon.rst b/changes/807-timonbimon.rst deleted file mode 100644 index 09a4cbd..0000000 --- a/changes/807-timonbimon.rst +++ /dev/null @@ -1 +0,0 @@ -add support for ``Type[T]`` type hints \ No newline at end of file diff --git a/changes/819-samuelcolvin.rst b/changes/819-samuelcolvin.rst deleted file mode 100644 index 6886f04..0000000 --- a/changes/819-samuelcolvin.rst +++ /dev/null @@ -1 +0,0 @@ -Performance improvements from removing ``change_exceptions``, change how pydantic error are constructed. diff --git a/changes/820-dmontagu.rst b/changes/820-dmontagu.rst deleted file mode 100644 index 06d1638..0000000 --- a/changes/820-dmontagu.rst +++ /dev/null @@ -1 +0,0 @@ -Fix the error message arising when a ``BaseModel``-type model field causes a ``ValidationError`` during parsing diff --git a/changes/821-samuelcolvin.rst b/changes/821-samuelcolvin.rst deleted file mode 100644 index 164455a..0000000 --- a/changes/821-samuelcolvin.rst +++ /dev/null @@ -1 +0,0 @@ -allow ``getter_dict`` on ``Config``, modify ``GetterDict`` to be more like a ``Mapping`` object and thus easier to work with diff --git a/changes/842-zpencerq.rst b/changes/842-zpencerq.rst deleted file mode 100644 index fcd1b34..0000000 --- a/changes/842-zpencerq.rst +++ /dev/null @@ -1 +0,0 @@ -Only check ``TypeVar`` param on base ``GenericModel`` class diff --git a/changes/847-samuelcolvin.rst b/changes/847-samuelcolvin.rst deleted file mode 100644 index 6a56668..0000000 --- a/changes/847-samuelcolvin.rst +++ /dev/null @@ -1,2 +0,0 @@ -**Breaking Change:** ``BaseSettings`` now uses the special ``env`` settings to define which environment variables to -read, not aliases. diff --git a/changes/851-samuelcolvin.rst b/changes/851-samuelcolvin.rst deleted file mode 100644 index e8b0da5..0000000 --- a/changes/851-samuelcolvin.rst +++ /dev/null @@ -1,2 +0,0 @@ -rename ``Model._schema_cache`` -> ``Model.__schema_cache__``, ``Model._json_encoder`` -> ``Model.__json_encoder__``, -``Model._custom_root_type`` -> ``Model.__custom_root_type__`` diff --git a/docs/index.rst b/docs/index.rst index b46e0c5..07f19fa 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -8,6 +8,11 @@ pydantic Current Version: |version| +.. note:: + + These docs refer to Version 1 of *pydantic* which is as-yet unreleased, *v0.32* docs are available + `here `_. + Data validation and settings management using python type hinting. Define how data should be in pure, canonical python; validate it with *pydantic*. diff --git a/pydantic/version.py b/pydantic/version.py index 04beafb..14a93cf 100644 --- a/pydantic/version.py +++ b/pydantic/version.py @@ -2,4 +2,4 @@ from distutils.version import StrictVersion __all__ = ['VERSION'] -VERSION = StrictVersion('1.0a1') +VERSION = StrictVersion('1.0b1')