Commit Graph

252 Commits

Author SHA1 Message Date
Samuel Colvin 31a0c2b1a9 uprev 2018-11-15 12:30:22 +00:00
Samuel Colvin b5fdc0db1e dataclass inheritance, fix #293 (#299) 2018-11-15 12:28:03 +00:00
Samuel Colvin ef140056fa cast datetime to date in parse_date, (#298)
* cast datetime to date in parse_date, fix #295

* tweak, update history
2018-11-15 12:21:15 +00:00
pyup.io bot 9d74ff9394 Scheduled monthly dependency update for November (#289)
* Update mypy from 0.630 to 0.641

* Update pytest from 3.8.1 to 3.9.3
2018-11-15 12:01:18 +00:00
Samuel Colvin 64ada930fc aliases, fix #275, replace #282 (#286) 2018-11-15 12:01:05 +00:00
Samuel Colvin 15850a43c5 moving to black (#287)
* moving to black

* put back flake8

* remove isort option

* putting back isort

* uprev pycodestyle

* remove black from docs/examples

* tweak parse.py
2018-11-15 11:30:07 +00:00
Guillermo cd50601172 Fix typos (#274) 2018-10-07 16:57:36 +01:00
Samuel Colvin 5089865857 uprev 2018-10-02 17:36:41 +01:00
pyup.io bot cdcf611f41 Scheduled monthly dependency update for October (#271)
* Update sphinx from 1.7.8 to 1.8.1

* Update mypy from 0.620 to 0.630

* Update pytest-cov from 2.5.1 to 2.6.0

* Update pytest-isort from 0.2.0 to 0.2.1
2018-10-02 17:34:46 +01:00
Samuel Colvin f3a278bb8d Dataclasses (#269)
* pydantic.dataclasses.dataclass decorator

* add dataclasses to requirnment.txt

* reimplement dataclasses

* fix linting, fix coverage

* docs
2018-10-01 09:48:28 +01:00
Samuel Colvin aac992abd5 tweak issue template 2018-09-28 16:03:13 +01:00
Samuel Colvin b0d8ee80ad fix coverage by ignoring coverage on 3.8 (#270) 2018-09-28 15:18:52 +01:00
Samuel Colvin 0a6c211d7f uprev 2018-09-21 10:39:09 +01:00
Nicholas Hyatt 10414a7a04 use type() in int validator (#264)
* use type() in int validator to avoid returning a bool since bool is and instance of int

* add note to HISTORY.rst

* add tests & add username and PR # to HISTORY.rst

* use not ininstance(v, bool) to allow int subclassing
2018-09-21 10:37:16 +01:00
Stefan Gangefors c32ce342c9 Add support for deep copying of models (#261)
Using `model.copy(deep=True)` will deep copy a module instance.

Making a deep copy is useful for models that have lists of dicts or
any other non-simple data structure to not accidentally modify data
between instances.

`model.copy()` behaviour is unchanged and will do a shallow copy of
the model instance.

fix #249
2018-09-10 11:35:58 -04:00
pyup.io bot 9f874a7e97 Scheduled monthly dependency update for September (#256)
* Update sphinx from 1.7.6 to 1.7.8

* Update attrs from 18.1.0 to 18.2.0

* Update pytest from 3.7.2 to 3.7.4
2018-09-10 05:46:05 -04:00
A. Hancock 5ee327c45b Remove extra 0 from v0.13.0 date in HISTORY.rst (#255) 2018-08-29 20:10:19 +01:00
Samuel Colvin c7c15bc415 fix json documentation (#253) 2018-08-29 10:38:02 +01:00
Samuel Colvin 0839646788 uprev 2018-08-25 17:15:22 +01:00
Samuel Colvin f46dc0c56f timedelta json encoding (#247)
* timedelta json encoding, altnative to #220

* history and tests

* fix comments and tests

* docs for json_encoders

* tests plain timedelta object parsing

* uprev

* tweak docs
2018-08-25 17:06:32 +01:00
Samuel Colvin e0a8dd2da8 issue and pull request templates, favicon 2018-08-25 16:49:36 +01:00
pyup.io bot f32ecf2258 Scheduled monthly dependency update for August (#240)
* Update sphinx from 1.7.5 to 1.7.6

* Update mypy from 0.610 to 0.620

* Update pycodestyle from 2.3.1 to 2.4.0

* Update pytest from 3.6.2 to 3.7.0

* uprev pytest

* reset pycodestyle
2018-08-20 12:03:54 +01:00
Nikita Grishko aad175a25f add `UrlStr and urlstr` types #236 (#246)
fix #236

* add ``UrlStr`` and ``urlstr`` types #236

* review fixes
2018-08-20 10:14:46 +01:00
Alban Diquet 8885503ccb Raise a NameError if a field name shadows a BaseModel attribute (#243)
* Raise a NameError if a field name shadows a BaseModel attribute fix #242

* Move the test and also check the names of non-annotation attributes

* Fix for flake8

* Fix import order

* Move validate_field_name to utils

* Linting

* Update history
2018-08-05 17:48:40 +01:00
Nikita Grishko 16eebf0c61 uprev 2018-07-31 21:44:37 +03:00
Nikita Grishko d293773370 fix schema generation for fields defined using `typing.Any` #237 (#238)
* fix schema generation for fields defined using ``typing.Any`` #237

* review fixes
2018-07-31 20:32:00 +02:00
Samuel Colvin 86da135a05 prepare for deploy 2018-07-31 14:00:14 +01:00
Samuel Colvin e0d8d960f3 improving schema (#232)
* improving schema, fix #213

* tweask and history
2018-07-31 10:55:02 +02:00
layday d1f1795db6 Test against 3.7.0 instead of an early alpha (#233)
* Test against 3.7.0 instead of an early alpha

* Try again
2018-07-25 16:25:20 +01:00
Samuel Colvin f48cb7b93c allow arbitrary times in Settings (#229) 2018-07-12 20:25:10 +01:00
Evghenii Goncearov a0e0aa4f79 Docs for json type (#228) 2018-07-11 15:08:51 +01:00
Samuel Colvin 1dc294015d cleaning up _populate_sub_fields, support tuples (#227)
* cleaning up _populate_sub_fields

* support tuples, fix #12

* fix, history and docs

* rename _create_sub_type
2018-07-10 18:45:15 +01:00
Samuel Colvin facfbddb91 tweak _validate_json 2018-07-10 17:22:13 +01:00
Evghenii Goncearov c31b8d6719 Json type (#214)
* Json type

* Sort imports

* one more unsorted import

* Changed the way Json type is defined

* Fix Function is too complex (C901) warning

* Fixed remarks

* Fix additional remarks

* Additional test

fix #195
2018-07-10 15:38:28 +01:00
Samuel Colvin 03517e4e07 fix FilePath and DirectoryPath (#226) 2018-07-07 16:58:58 +01:00
Nikita Grishko 489a1d32b1 add `by_alias argument in .dict() and .json()` model methods (#222)
* add ``by_alias`` argument in ``.dict()`` and ``.json()`` model methods #205

* review fixes

fix #205
2018-07-07 15:06:55 +01:00
Samuel Colvin 725b3c3bcf uprev 2018-07-05 14:48:47 +01:00
Samuel Colvin f6643d60f9 add validate_model (#224)
* add validate_model, fix #221

* errors None from validate_model if ok
2018-07-05 14:42:40 +01:00
Samuel Colvin c0413c8896 list, set, tuple validation (#225)
* list, set, tuple validation, fix #202

* update HISTORY.rst
2018-07-04 16:32:42 +01:00
Nikita Grishko c002c490ae add `NewType` support #115 (#223)
* add ``NewType`` support #115

* updated history

fix #115
2018-07-04 16:11:55 +01:00
Nikita Grishko f2190c4b24 uprev 2018-07-02 10:08:29 -07:00
Samuel Colvin 85f8a6b60e fix benchmarks with 3.7 (#219) 2018-07-02 12:28:46 +01:00
pyup.io bot 9f83ca48b9 Scheduled monthly dependency update for July (#217)
* Update sphinxcontrib-websupport from 1.0.1 to 1.1.0

* Update mypy from 0.600 to 0.610

* Update pycodestyle from 2.3.1 to 2.4.0

* Update pytest from 3.6.0 to 3.6.2

* revert pycodestyle agaaaain
2018-07-02 12:12:01 +01:00
Samuel Colvin a821cbfea9 update history 2018-07-02 12:11:38 +01:00
Evghenii Goncearov 73015d2a72 Allow arbitrary types in model (#209)
* Allow arbitrary types in model

* Replaced ConfigError with RuntimeError

* Corrections of the ArbitraryTypeError exception class
2018-07-02 12:08:43 +01:00
layday 8f42e515d5 Add support for Python 3.7 (#216)
* Add support for Python 3.7

* fixup! Add support for Python 3.7

* fixup! Add support for Python 3.7

* fixup! Add support for Python 3.7
2018-07-01 00:26:07 +01:00
Nikita Grishko d43ab483ee fix schema creation docs (#212)
* fix schema creation docs

* review fixes
2018-06-30 23:06:39 +01:00
Samuel Colvin 37364a05b9 implement JSON serialisation (#210)
* implement JSON serialisation, fix #133

* documenting JSON serialisation

* fix coverage
2018-06-28 18:21:45 +01:00
Samuel Colvin 596ddac02e uprev 2018-06-28 13:07:57 +01:00
Samuel Colvin dd8d013e10 Schemas (#190)
* starting field and model schemas

* field.schema()

* sub-models working

* move default in Schema and tests

* adding schema

* tweak docs
2018-06-28 13:06:24 +01:00