Commit Graph

497 Commits

Author SHA1 Message Date
Samuel Colvin 32efbf069b dataclass import alias for export (#783)
* dataclass import alias for export, fix #781

* support --no-implicit-reexport in pydantic, add changes
2019-08-28 11:54:59 +01:00
Scott P 5015a7e48b Improve auto-generated title in JSON schemas (#772)
* Improve auto-generated title in JSON schemas

Underscore is converted to space.

* Added changes .rst file.
2019-08-21 16:49:05 +01:00
Matin Tamizi 00210716a7 used by Cuenca (#777) 2019-08-21 16:48:25 +01:00
Samuel Colvin 9dee83a689 better error message for TypeError on datetime parsing (#766)
* better error message for TypeError on datetime parsing

* add change, fix tests

* reduce scope of errors caught
2019-08-21 13:45:11 +01:00
Daniel Petti aa5e8c60b7 Feature/frozenset support (#762)
* Better error for unsuported "typing" objects.

Fixes #745

Add a better error message for fields with types from the typing
module that are not directly supported by Pydantic. Previously,
it caused a cryptic assertion failure.

* Add support for frozenset fields.

Also provide an example of their usage.

Fixes #745

* Address review comments.

Fixes #745

* use equals not "is" for int comparison.
2019-08-21 13:13:46 +01:00
Samuel Colvin 5f634067da moving typing related objects into typing.py (#761)
* moving typing related objects into typing.py, fix #713

* cleanup
2019-08-21 12:49:19 +01:00
dmontagu 756454fb58 Change defaults for BaseSettings (#747)
* Change defaults for BaseSettings

* Update docs and fix build

* Minor documentation fixes

* Fix lowercase issues

* Update docs and fix build

* Fix formatting

* Try with monkeypatched test

* Fix doublequotes

* Change case_insensitive to case_sensitive

* more change details.
2019-08-21 12:48:28 +01:00
dmontagu 5e8db161b8 Preserve annotations from bases (#758)
* Preserve annotations from bases

* Incorporate feedback

* Update tests based on feedback
2019-08-21 12:45:50 +01:00
dependabot-preview[bot] 9c30712162 Bump pytest from 5.1.0 to 5.1.1 (#774)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.1.0 to 5.1.1.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.1.0...5.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-21 12:09:03 +01:00
pyup.io bot 6235ac2153 Update sphinx from 2.1.2 to 2.2.0 (#765) 2019-08-18 17:10:20 +01:00
Samuel Colvin 0e8cfba713 small performance improvements to validators and fields (#763)
* small performance improvements to validators and fields

* simplify ErrorWrapper and ValidationError

* more cleanup of errors, combine test_error_wrapper.py and test_error.py

* tweak datetime_parse.py

* fix for python 3.6

* add change

* fix bug with int or float passed to datetime.time
2019-08-18 16:48:39 +01:00
Samuel Colvin 4b477d79e4 adding codecov.yml (#764) 2019-08-18 15:58:45 +01:00
dmontagu 65d838aa88 Serialize only __root__ value (#752)
* Serialize only __root__ value, fix #730

* Add changes and fix docs

* Clean up root model docs

* Update docs/index.rst

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* Update docs/index.rst

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* Rename variable

* fix rst in change description
2019-08-17 18:58:32 +01:00
dmontagu 27bb336545 Fix broken examples (#753)
* Fix broken examples

* Update changes
2019-08-17 13:03:53 +01:00
dmontagu 6c0f4f31d1 Test mypy integration with pytest (#735)
* Test mypy integration with pytest

* Fix for without deps

* Fix filenames issue

* Remove python run in external-mypy

* Update changes

* Remove external-mypy
2019-08-17 12:59:11 +01:00
Koudai Aono 08c6af8ae2 add documentation for PyCharm Plugin (#750)
* add documentation for PyCharm Plugin

* add a change document for a history

* Delete typing.py

* update documents

* Apply suggestions from code review

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
2019-08-16 11:37:13 +01:00
Raphael de Carvalho Almeida 5b5451c02e Added initvars support to post_init_post_parse (#748)
* Added initvars support to post_init_post_parse

* Update change log with PR number

* Add practical initvars example to tests

* Update documentation
2019-08-16 09:36:56 +01:00
dependabot-preview[bot] cac933309e Bump pytest from 5.0.1 to 5.1.0 (#751)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.0.1 to 5.1.0.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/5.0.1...5.1.0)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-08-16 09:10:50 +01:00
Abdussamet Koçak f41d5dca3c Support assert statements inside validators (#653)
* Support assert statements inside validators

* Add a validator example that uses assert

* Add warning about consequences of using -O optimization flag

* Fix a typo

* Fix incomplete validator

* Extend exception name generation

* Improve tests

* Clarify pytest behaviour

* handle assertion error name, fix build

* Address feedback

* docs cleanup

* Incorporate feedback

* fix quotes
2019-08-15 12:06:21 +01:00
dmontagu 321cde0c88 Include all annotated fields in order (#715)
* Include all annotated fields in order

* Update docs and changes

* fix field ordering

* update change info

* fix coverage
2019-08-12 12:05:22 +01:00
Samuel Colvin 82ef45c890 alter the behaviour of dict(model) so that sub-models are nolonger converted to dictionaries (#733)
* fix iteration to not convert to dict by default

* add change

* remove extra newline
2019-08-12 11:31:35 +01:00
Samuel Colvin 5837acb288 test demonstrating internal ValidationError (#738)
* test demonstrating internval ValidationError

* fix #736
2019-08-11 14:14:02 +01:00
Samuel Colvin 929dab6cda tweak PR template 2019-08-10 13:34:21 +01:00
dmontagu 72edca7532 Make bool_validator strict (#617)
* Make bool_validator strict

* incorporate feedback

* Add RelaxedBool

* Fix position in schema.py

* update BoolError message

* Incorporate feedback

* Update history

* Add changes

* Update docs/index.rst

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* Update docs/index.rst

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* Update tests/test_types.py

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* Incorporate feedback

* Update booleans.py

* Remove RelaxedBool

* tweak docs and update changes to new format
2019-08-10 12:00:29 +01:00
Samuel Colvin e6c44ee069 Merge pull request #720 from samuelcolvin/remove-deprecated-code
Remove old, deprecated code
2019-08-08 11:55:53 +01:00
Samuel Colvin 675f65921b add "Sponsor" button
Experiment to see if anyone will actually contribute to OSS they use and rely on.
2019-08-07 16:52:34 +01:00
Samuel Colvin 72bada8ca8 add change, and tweak change format 2019-08-06 16:37:38 +01:00
Samuel Colvin 19834d33ff Remove old, deprecated code 2019-08-06 16:30:37 +01:00
Samuel Colvin 485197c8e1 note about creating issue before PR 2019-08-06 16:25:38 +01:00
Samuel Colvin d97aec6174 Merge pull request #719 from samuelcolvin/v1-prep
Preparation for Version 1
2019-08-06 16:20:17 +01:00
Samuel Colvin 9c8bba71c6 Preparation for Version 1 2019-08-06 16:19:38 +01:00
Samuel Colvin 10c18ee63d uprev 2019-08-06 15:42:49 +01:00
Samuel Colvin 6316a6a219 Merge pull request #663 from tiangolo/schema-extra
Implement schema_extra
2019-08-06 15:35:21 +01:00
Samuel Colvin 8850a0b136 tweak history 2019-08-05 15:51:21 +01:00
Sebastián Ramírez 3cb52b94d2 Fix double quotes to single quotes 2019-08-05 09:47:15 -05:00
Sebastián Ramírez f505da5f07 Update History 2019-08-05 09:47:15 -05:00
Sebastián Ramírez 3bffe69fa5 Add schema_extra and title in docs for Config sub-class 2019-08-05 09:46:27 -05:00
Sebastián Ramírez a8ab92f382 Add example and docs for schema_extra in Config 2019-08-05 09:45:37 -05:00
Sebastián Ramírez d4d9e9e7d7 Implement Config attribute schema_extra, to allow extending a generated schema 2019-08-05 09:45:37 -05:00
Samuel Colvin 6be7c2103b Merge pull request #706 from koxudaxi/support_forwardred_in_python36
support ForwardRef in Python 3.6
2019-08-05 13:27:23 +01:00
Koudai Aono 75afb3f178 merge HISTORY 2019-08-05 21:01:28 +09:00
Koudai Aono b5d5e591ec Merge remote-tracking branch 'upstream/master' into support_forwardred_in_python36 2019-08-05 21:00:01 +09:00
Koudai Aono cffcb39c7c add unittest for python3.7 2019-08-05 20:46:56 +09:00
Samuel Colvin b479b93c40 Merge pull request #712 from MrMrRobat/__dict__-instead-of-__values__
Rename BaseModel.__values__ to  BaseModel.__dict__
2019-08-05 11:48:09 +01:00
Samuel Colvin bbdc8e8038 add test_init_inspection 2019-08-05 11:35:49 +01:00
Arseny Boykov f01cedca14 Merge branch 'master' into __dict__-instead-of-__values__ 2019-08-05 12:58:46 +03:00
Samuel Colvin 49178a368d Merge pull request #676 from dmontagu/type-in-validation-error
Add type name to ValidationError error message
2019-08-05 10:50:30 +01:00
MrMrRobat 86be8b2012 Union changes messages 2019-08-05 12:49:12 +03:00
Samuel Colvin 7ace58cad8 Merge branch 'master' into type-in-validation-error 2019-08-05 10:37:42 +01:00
MrMrRobat 0c3093be5f Merge remote-tracking branch 'origin/__dict__-instead-of-__values__' into __dict__-instead-of-__values__ 2019-08-04 01:35:07 +03:00