Commit Graph

587 Commits

Author SHA1 Message Date
Sebastian Mika b87ca4ee05 benchmark for cattrs (#513)
* benchmark for attr

* update HISTORY.rst

* * added benchmark using cattr
* add env "ATTRS=1" to benchmark runner to only compare again the two
  and save results in separate csv
* added section to docs/index

* nits

* re-run benchmark with cython pydantic; merge results back to main benchmarks results table

* pin pydantic to top of benchmark report

* remove attrs, fix cattrs

* update benchmarks output

* add change
2019-11-08 17:04:41 +00:00
Samuel Colvin f9576e7a45 python 3.8 tests on azure (#973)
* python 3.8 tests on azure

* bump

* use windows-latest and azure image
2019-11-08 16:39:14 +00:00
Daniel Smith a34118f392 Adds MolSSI to companies (#983) 2019-11-08 15:20:20 +00:00
Samuel Colvin 093474ae27 fix coverage on generics.py (#976) 2019-11-07 16:24:12 +00:00
Samuel Colvin 8a261c1dfa uprev and generate history 2019-11-07 15:20:27 +00:00
Samuel Colvin 17b5ff42c1 renaming docs examples (#972)
* renaming docs examples

* tweaks
2019-11-07 14:40:44 +00:00
Samuel Colvin 1d3f7824ec Fix broken Any and TypeVar behaviour (#962)
* tests for broken Dict behaviour

* fix Any, support TypeVar

* change type of field.type_

* add docs and example for TypeVar
2019-11-07 12:31:26 +00:00
Samuel Colvin afa0bd4104 set FieldInfo on subfields (#969)
* set FieldInfo on subfields

* fix coverage
2019-11-07 10:34:49 +00:00
dependabot-preview[bot] a0f9a93dda Bump cython from 0.29.13 to 0.29.14 (#964)
Bumps [cython](https://github.com/cython/cython) from 0.29.13 to 0.29.14.
- [Release notes](https://github.com/cython/cython/releases)
- [Changelog](https://github.com/cython/cython/blob/master/CHANGES.rst)
- [Commits](https://github.com/cython/cython/compare/0.29.13...0.29.14)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-05 10:01:49 +00:00
dependabot-preview[bot] d701f01c0b Bump flake8-quotes from 2.1.0 to 2.1.1 (#963)
Bumps [flake8-quotes](https://github.com/zheller/flake8-quotes) from 2.1.0 to 2.1.1.
- [Release notes](https://github.com/zheller/flake8-quotes/releases)
- [Commits](https://github.com/zheller/flake8-quotes/compare/2.1.0...2.1.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-11-05 10:01:22 +00:00
dmontagu 0c18619769 Mypy plugin (#722)
* Add mypy plugin

* Make all arguments optional for BaseSettings

* Get test coverage up

* Add changes

* Add type-checking for BaseModel.construct, and checking for from_orm

* Fix formatting and linting

* Fix the build

* Heavy refactor of plugin and mypy tests

* Make linting pass

* Handle dynamic aliases

* Better organize plugin code

* Add docs

* Add support for error codes

* Fix minor docs typo

* Rename config settings, add docstrings, and incorporate other feedback

* Incorporate feedback

* Update docs, remove dataclasses for cython

* fix mypy example
2019-10-31 13:19:01 +01:00
Scott P 347be1cc3c Fixed PositiveFloat and PositiveInt description (#945)
* Fixed PositiveFloat and PositiveInt description

changed "negative" word to "positive"

* "a int" -> "an int"
2019-10-30 13:24:48 +01:00
dmontagu cb2a302520 Fix generic typehint for pycharm (#936)
* Fix generic typehint for pycharm

* Add changes
2019-10-29 15:15:28 +01:00
dependabot-preview[bot] e5f98a5734 Bump black from 19.3b0 to 19.10b0 (#949)
Bumps [black](https://github.com/psf/black) from 19.3b0 to 19.10b0.
- [Release notes](https://github.com/psf/black/releases)
- [Commits](https://github.com/psf/black/commits)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-29 13:06:01 +01:00
dependabot-preview[bot] 9f3b970285 Bump typing-extensions from 3.7.4 to 3.7.4.1 (#948)
Bumps [typing-extensions](https://github.com/python/typing) from 3.7.4 to 3.7.4.1.
- [Release notes](https://github.com/python/typing/releases)
- [Commits](https://github.com/python/typing/compare/3.7.4...3.7.4.1)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-29 13:05:43 +01:00
dependabot-preview[bot] 63d8d47dea Bump flake8 from 3.7.8 to 3.7.9 (#950)
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.7.8 to 3.7.9.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.7.8...3.7.9)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-29 13:05:27 +01:00
dependabot-preview[bot] cec6a5e302 Bump pytest from 5.2.1 to 5.2.2 (#933)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 5.2.1 to 5.2.2.
- [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.2.1...5.2.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-26 22:27:36 +01:00
Samuel Colvin 25f657fd5f site search, fix #931 2019-10-24 15:07:19 +01:00
Samuel Colvin 8f8b052ab6 fix PR template 2019-10-24 10:43:49 +01:00
dependabot-preview[bot] 8a2db9121a Bump pytest-mock from 1.11.1 to 1.11.2 (#929)
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 1.11.1 to 1.11.2.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/master/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v1.11.1...v1.11.2)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-24 10:30:32 +01:00
Samuel Colvin b8bbfec670 release notes for v1 (#918)
* release notes for v1

* uprev and tweaks

* Apply suggestions from code review

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>

* tweak notes, add back link to old docs

* build changelog
2019-10-23 11:48:14 +01:00
retnikt dccc4014dc Clarify documentation and error message about keep_untouched (#926)
* Clarify keep_untouched documentation (#924)

* Clarify error message for custom types (#924)

* Fix tests for changed error message (#924)

* fix formatting

* remove erroneous error message and add change
2019-10-23 11:14:51 +01:00
Samuel Colvin bab6970f12 allow abstract sets in include and exclude arguments (#921)
* allow abstract sets in include and exclude arguments

* add change

* correct type hints
2019-10-23 11:03:29 +01:00
retnikt 80c2fb1545 mention python 3.8 in docs (#927) 2019-10-23 11:02:34 +01:00
Samuel Colvin 677677e536 modify behaviour of the construct method (#898)
* modify behaviour of the construct method

* change construct signature

* Add example for construct function (#907)

* add example for construct

* edit exporting_models

* typo

* add changes file

* code review changes

* fix bad copy paste

* extend example in docs

* use __field_defaults__ in construct
2019-10-23 10:49:05 +01:00
Samuel Colvin cb262daddd fix ValidationError.json() (#922) 2019-10-23 10:27:55 +01:00
dmontagu 6b5adcc977 Rename skip-defaults, and add ability to exclude actual defaults (#915)
* Rename skip-defaults, and add ability to exclude actual defaults

* Add __defaults__ and deprecation warnings

* Add note about `skip_defaults` to docs

* Incorporate feedback

* Add tests and changes

* Fix reference to .json()
2019-10-23 10:14:51 +01:00
Samuel Colvin f5cde39e75 ConstrainedList improvements, fix #913 (#917) 2019-10-21 12:15:54 +01:00
dependabot-preview[bot] c7121ded2f Bump email-validator from 1.0.4 to 1.0.5 (#916)
Bumps [email-validator](https://github.com/JoshData/python-email-validator) from 1.0.4 to 1.0.5.
- [Release notes](https://github.com/JoshData/python-email-validator/releases)
- [Commits](https://github.com/JoshData/python-email-validator/compare/v1.0.4...v1.0.5)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>
2019-10-21 09:21:43 +01:00
Samuel Colvin 7db098fa49 get item type in get_annotation_from_field_info (#909)
* get item type in get_annotation_from_field_info, fix #779

* check constraints are enforced

* add change

* tests for phony constraints

* rewrite get_annotation_from_field_info

* fix tests

* add constaint enforcement to docs

* fix get_annotation_from_field_info coverage

* fix linting

* update docs as per @tiangolo suggestions
2019-10-18 17:41:10 +01:00
Samuel Colvin 78921da353 better str and repr for ModelField (#912)
* better str and repr for ModelField, fix #505

* better type display, fix tests

* correct _type_display signature

* fix for python3.6 differences

* fix PyObjectStr

* fix coverage
2019-10-18 14:32:30 +01:00
nu_no ca1fa934ec Add installation from repository (#900)
It think it's a good idea given that some features that are mentioned in the documentation (such as `root_validator`) are not yet in the current PyPI version.
2019-10-18 10:35:19 +01:00
dependabot-preview[bot] 2427f635e8 Bump mypy from 0.730 to 0.740 (#910)
* Bump mypy from 0.730 to 0.740

Bumps [mypy](https://github.com/python/mypy) from 0.730 to 0.740.
- [Release notes](https://github.com/python/mypy/releases)
- [Commits](https://github.com/python/mypy/compare/v0.730...v0.740)

Signed-off-by: dependabot-preview[bot] <support@dependabot.com>

* remove unused 'type: ignore'
2019-10-17 15:33:14 +01:00
Trim21 afba60f112 update docs for bool to match code (#911)
* update docs for bool to match code

* add changelog
2019-10-17 14:57:56 +01:00
Samuel Colvin ed7b216e5f Change alias precedence to prefer child models (#904)
* Change alias precedence to prefer child models

* add docs about alias precedence

* correct change
2019-10-17 10:58:28 +01:00
Samuel Colvin 87fb5cce12 change CI to 3.8 (#902)
* change CI to 3.8

* fix linting

* travis jobs for 3.8

* redo noqa comments

* add 3.8 to azure
2019-10-17 10:01:27 +01:00
Ivan Dmitrievsky 806eba3810 Merge init_kwargs with env variables recursively to handle nested values (#891)
* Merge init_kwargs with env variables recursively to handle nested values

This commit implements `deep_update` function that works as standard
`update` method on dicts, but also recursively updates all the nested
dict values. It allows splitting init arguments between environment
variables and in-code values, as long as they create a valid object
when merged together.

* Add entry to changes directory

* Fix CI/CD checks

* Make deep_copy not mutating, improve tests and type annotations
2019-10-15 11:24:46 +01:00
Samuel Colvin 6cda388c7a exclude unused files from docs (#896) 2019-10-15 00:16:27 +01:00
Ashton Shears b1e61b415a change secret types example (#890)
* change secret types example

* add changes file

* add address review comments

* remove redundant str() call
2019-10-14 18:00:37 +01:00
Samuel Colvin c3098a30cf Consistent __repr__ and __str__ methods for all types (#884)
* Consistent __repr__ and __str__ methods for all types

* add change description

* devtools integration and feedback on repr methods

* fix Color repr

* tests for truncate

* add devtools section to docs

* tests for devtools

* ValidationError inheriting from Representation

* fix imports

* tweaks

* tweak docs

* exec_examples.py integration with __repr__ changes
2019-10-14 17:37:04 +01:00
Samuel Colvin e7227db41a Insert prints in docs. (#895)
* starting insert prints

* working exec_script

* remove prints, fix exec_examples.py

* more cleanup of examples, better model printing

* upgrade netlify runtime

* extra docs deps

* few more small tweaks
2019-10-14 16:40:25 +01:00
retnikt 97b163db5f fix formatting for datetime nested bullet points in docs/usage/types.md (#887) 2019-10-11 17:26:02 +01:00
Samuel Colvin d6d8d7f9ed correct command formatting in docs/usage/mypy 2019-10-11 17:13:43 +01:00
Samuel Colvin d381fe84c6 deprecate case_insensitive on BaseSettings config (#885) 2019-10-11 15:59:02 +01:00
Samuel Colvin d0c6ec7009 deprecate Model.fields for Model.__fields__ (#883)
* deprecate Model.fields, use Model.__fields__

* correct docs
2019-10-11 11:10:02 +01:00
Samuel Colvin 41d79de3a9 fix subtle issue with settings env variables (#882) 2019-10-10 13:24:50 +01:00
Samuel Colvin bd8918bfab use FutureWarning in settings so it's printed (#881)
* use FutureWarning in settings so it's printed

* fix tests

* better warning link

* change warning link
2019-10-10 13:24:23 +01:00
Samuel Colvin f3dd39c1bb Few more tweaks to docs (#879) 2019-10-10 12:10:39 +01:00
dmontagu beb57364d2 Lots of minor docs tweaks (#877)
* Lots of minor changes

* More tweaks

* Remove git conflicts

* suggested tweaks
2019-10-10 12:00:22 +01:00
Koudai Aono 46db1efdfc Fix field of a type that has a default value (#880)
* fix type field

* update changes

* add testcase

* separate test for type fields
2019-10-09 14:06:15 +01:00