Commit Graph

325 Commits

Author SHA1 Message Date
Vitaly R. Samigullin cd39ade9ec datetime types docs added (#431)
* datetime types docs added

* datetime docs format changed
2019-03-23 10:51:34 +00:00
Nejc Zupan ac99083a82 Tiny typo (#427) 2019-03-21 00:47:50 +00:00
Vitaly R. Samigullin 0458f9ece9 IPv{4,6,Any}{Interface,Network} types added (#419)
* IPv{4,6,Any}{Network,Interface} types added, unittests and docs updated

* HISTORY.rst minor update

* Remove strict argument from IP network types

* IP Networks validators and type hints fixed

* tweak history
2019-03-20 18:13:04 +00:00
Samuel Colvin 1fd509d8a4 correct imports, fix #420 (#423) 2019-03-18 11:41:06 +00:00
Samuel Colvin f81aa969ae uprev 2019-03-15 12:23:02 +00:00
pyup.io bot 721f17d2b5 Scheduled monthly dependency update for March (#410)
* Update sphinx from 1.8.3 to 1.8.4

* Update flake8 from 3.7.4 to 3.7.7

* Update isort from 4.3.4 to 4.3.9

* Update mypy from 0.660 to 0.670

* Update pyflakes from 2.1.0 to 2.1.1

* Update pytest from 4.2.0 to 4.3.0

* Update pytest-mock from 1.10.0 to 1.10.1
2019-03-15 11:37:52 +00:00
Vitaly R. Samigullin f41e3afaa0 ipaddress.IPAddress support (#417)
* ipaddress-compatible types added, fix #333

* Unittests for ipaddress-types added

* Docs updated after ipaddress-types added

* HISTORY.rst updated to reflect ipaddress-related types introduction

* Fix docs table format

* Strings double quotes reverted

* ipaddress types support fixed, IPvAnyAddress type redefined

* Error handling fixed for ipaddress-related types

* Positive cases for IPv4Address and IPv6Address types in unittests added
2019-03-15 10:18:06 +00:00
Yaraslau Zhylko 37855aa90c fix typo in NoneIsNotAllowedError message (#414)
* fix typo in `NoneIsNotAllowedError` message

* Add HISTORY.rst entry
2019-03-07 13:33:58 +00:00
Samuel Colvin 7b126a7af6 update history 2019-02-26 09:21:00 +00:00
layday 0a9b720068 Fix the type hint of ValidationError.json (#406)
As per the json.dumps documentation.
2019-02-26 09:19:44 +00:00
Samuel Colvin 951daa7c5f submodel validation, fix #403 (#407) 2019-02-25 15:22:19 +00:00
Andrey Golovizin e77bc00d6e Fix type hints of parse_obj and similar methods (#405) 2019-02-21 22:23:50 +00:00
Samuel Colvin 7cd423aa3e uprev 2019-02-18 08:44:26 +00:00
Samuel Colvin 1161df3ca0 support ForwardRef on dataclasses (#399)
* support ForwardRef on dataclasses, fix #397

* explicit docs about when postponed annotations don't work
2019-02-18 08:41:35 +00:00
Daniel Smith 5438aa5c91 Allow autocompletion of fields (#398)
* Allows interactive usage to autocomplete fields

* History add now that PR # is available
2019-02-18 07:53:02 +00:00
Samuel Colvin 27323aa8b2 fix for python 3.8 (#396)
* fix for python 3.8

* history and tweak types in main.py
2019-02-15 18:29:13 +00:00
Samuel Colvin f9bc56a70a update HISTORY.rst ready for release 2019-02-13 15:47:28 +00:00
Yaraslau Zhylko d539bcd87d Fix extra behaviour for multiple inheritance/mix-ins (#394)
* Fix `extra` behaviour for multiple inheritance/mix-ins

* Update HISTORY
2019-02-13 15:40:38 +00:00
Jere Lahelma db53fad28d add py.typed marker file for PEP-561 support (#391)
Fix #390

Disable zip_safe option as mypy is incompatible with it.
2019-02-13 15:11:33 +00:00
Daniel Smith 96e3e74262 Tracking for setting attributes (#389)
fix #378

* Tracking for setting attributes

* Fixes accidental leak of fields

* Allows defaults fields to be recursively set

* Docs and history for skip_defaults

* Mypy fix on calculate keys

* Update pydantic/main.py

Co-Authored-By: dgasmith <dgasmith@icloud.com>

* Update pydantic/main.py

Co-Authored-By: dgasmith <dgasmith@icloud.com>

* Update HISTORY.rst

Co-Authored-By: dgasmith <dgasmith@icloud.com>

* Cleanup pass based off review

* Simplifies constructors based on feedback

* Makes mypy happy with exlicit KeysView

* SetOrKeys and faster key search

* Formats files once more

* add tests for dict, pickle and construct

* fixes for dict, pickle and construct

* correct field_set for extra.ignore

* Fixes format
2019-02-13 15:10:45 +00:00
Samuel Colvin baade9a117 rebuild validator arguments (#388)
* rebuild validator arguments

* cleanup and tests

* update docs
2019-02-13 10:31:36 +00:00
Samuel Colvin 8fa1382beb change ms/s watershed for datetime parsing (#385)
* change ms/s watershed for datetime parsing

* more tests for ms, μs and ns

* fix formatting

* uprev
2019-02-04 22:09:51 +00:00
Samuel Colvin 04391da318 fix for 'missing' error with validate_all or validate_always (#381)
* fix for 'missing' error with validate_all or validate_always

* update HISTORY
2019-02-04 21:57:44 +00:00
Samuel Colvin 9ef401839b add type hints (#373)
* add type hints, fix #372

* fix tests and BaseModel inference

* fix #280

* fix dataclasses and docs

* more typing

* adding hints to fields.py

* type **EVERTHING*

* fix for 3.6

* small speed ups and some typ checks

* correct model.copy

* update history
2019-02-04 21:54:20 +00:00
pyup.io bot a85334682c Scheduled monthly dependency update for February (#382)
* Update flake8 from 3.6.0 to 3.7.4

* Update mypy from 0.650 to 0.660

* Update pycodestyle from 2.4.0 to 2.5.0

* Update pyflakes from 2.0.0 to 2.1.0

* Update pytest from 4.0.2 to 4.2.0

* Update pytest-cov from 2.6.0 to 2.6.1

* fix test linting
2019-02-04 20:31:42 +00:00
Or Carmi 9900c7f00c Refactored extra types to use a single enum (#352)
deprecated `ignore_extra` and `allow_extra` Config fields in favor of `extra`, fix #352

* refaactored extra types to use a single enum

* slightly simplified

* added tests

* fixed most stuff

* docs and some simplifications

* better assert

* changed enum and fixed logic

* trying to capture deprecation warning

* make format

* fixing tests and moving exta logic to __new__

* set_extra tests

* fox benchmarks

* formatting

* updated history

* docs

* added a negative tests

* reverted format changes

* format

* matched casing

* renamed values

* more fixes

* forgot values change

* another one

* weird stuff

* linting issue

* Update pydantic/main.py

Co-Authored-By: liiight <4374581+liiight@users.noreply.github.com>
2019-02-04 13:15:07 +00:00
Stephen Brown II 61e758965c Add multiple_of attribute to constrained numerics (#371)
* Add multiple_of attribute to constrained numerics

* Update HISTORY.rst

* make format

* Change limit_value -> multiple_of
2019-02-03 17:13:27 +00:00
James Bradshaw 67c965fb50 Fix typo in index.rst (#383) 2019-02-03 17:10:54 +00:00
Samuel Colvin f287d41590 correct python_tag, fix #376 (#379) 2019-01-30 17:22:51 +00:00
Sebastián Ramírez 725e86a8f0 custom validators in schema (#375)
* Test NoneType directly in Field.include_in_schema and add test for validator

fix #363

* Update History
2019-01-30 10:31:45 +00:00
Artem Malyshev 987449a922 Support typing.Callable validation. (#364)
fix #279

* Support typing.Callable validation.

* Add myself to HISTORY.

* Prove it works with just Callable.

* Document callable validator behavior.

* Support differences in typing module between py36 and py37.

* Remove callable filed from JSON schema with warning.

* Update pydantic/schema.py

Co-Authored-By: proofit404 <proofit404@gmail.com>

* Update tests/test_callable.py

Co-Authored-By: proofit404 <proofit404@gmail.com>

* Update pydantic/validators.py

Co-Authored-By: proofit404 <proofit404@gmail.com>

* Update tests/test_callable.py

Co-Authored-By: proofit404 <proofit404@gmail.com>

* Move callables to the exotic types.

* Move Callable type choice to the import time.

* Move is_callable_type to the utils module.

* Raise warning at skip except.

* Update pydantic/schema.py

Co-Authored-By: proofit404 <proofit404@gmail.com>

* Update docs/index.rst

Co-Authored-By: proofit404 <proofit404@gmail.com>

* Update pydantic/schema.py

Co-Authored-By: proofit404 <proofit404@gmail.com>

* uprev

* Update index.rst (#370)

* Update history.rst

* Make the example a little more concise.

* Use callable import from the utils.

* Remove blank line.

* Remove duplication comments.

* fix history
2019-01-29 15:42:00 +00:00
Daniel Smith 39dd347607 Update index.rst (#370) 2019-01-26 17:55:29 +00:00
Samuel Colvin 06b0c41276 uprev 2019-01-22 18:34:28 +00:00
Samuel Colvin 2fb0b26b81 tweak schema, fix #361 (#362) 2019-01-20 14:50:49 +00:00
Samuel Colvin 8cb3557aec adding MANIFEST.in (#358)
* adding MANIFEST.in

* uprev
2019-01-17 20:59:58 +00:00
Nikita Grishko 145f04cb5d add `ConstrainedBytes and conbytes` types #315 (#357)
fix #315
2019-01-17 13:57:49 +00:00
Samuel Colvin 0c1482aaba uprev 2019-01-13 09:12:44 +00:00
Samuel Colvin 3c3c0262c0 add contributing docs, (#354)
* add contributing docs, fix #353

* tweaks

* tweaks
2019-01-11 21:08:14 +00:00
Samuel Colvin 25b5d98030 support postponed annotations and ForwardRef in python 3.7 (#348)
* support postponed annotations in python 3.7

* support for full ForwardRef

* tweak update_forward_refs

* better ForwardRef resolution

* remove debug, fix linting

* fix comments

* docs and history
2019-01-11 21:01:07 +00:00
Sebastián Ramírez 32d5cdcb30 Fix BaseConfig max_anystr_length default to fixed number to None (#350)
* Fix BaseConfig max_anystr_length default to fixed number to None

* Update History
2019-01-07 13:59:25 +00:00
Samuel Colvin 3c4c163dc5 fix allow_population_by_alias (#346)
* fix allow_population_by_alias, fix #257

* update history
2018-12-29 16:16:10 +00:00
Samuel Colvin dd202998bd improve docs for allow_extra and ignore_extra, fix #301 (#345) 2018-12-29 12:32:50 +00:00
Samuel Colvin 19320bf775 improve settings priority, (#343)
* improve settings priority, ref #341

* add HISTORY.rst

* move is_complex and rename _build_environ

* tweak
2018-12-29 12:31:53 +00:00
Samuel Colvin 6514307677 update pull request template 2018-12-29 12:01:05 +00:00
Samuel Colvin 0f7f8fcf14 allow validate_always with default=None (#344)
* allow validate alwasy with None, fix #132

* prevent whole validators being called on subitems

* improve Optional validators edge cases
2018-12-29 11:07:45 +00:00
Samuel Colvin b43b887ec3 docs typo 2018-12-28 16:11:00 +00:00
Samuel Colvin eeb48fbeac don't call validators on keys of dictionaries, fix #254 (#342) 2018-12-28 16:07:48 +00:00
Samuel Colvin 3d4dc90d4b classifiers and python-tag 2018-12-27 23:44:13 +00:00
Samuel Colvin 993510d531 set release date 2018-12-27 22:35:09 +00:00
Samuel Colvin c2bae0a05d support ClassVar, (#339)
* support ClassVar, fix #184

* fix tests, update history
2018-12-27 20:44:02 +00:00