* allow Config.field to update a Field, fix#2426
* move logic to update_from_config, work with Annotated
* fix flake8 erroneous warnings
* test for allow_mutation
* better support for allow_mutation
* Add pickle support to dynamically created models
* Add created model module check
* Use globals() to retrieve model
* Use single quotes
* use mocker instead of mock
Co-authored-by: PrettyWood <em.jolibois@gmail.com>
* remove unused import
* add test for dynamic forward ref
* move generic test to test_generics.py
* fix test_generic_model_pickle test, add additional check for <locals> in create_model
* fix code style
* resolve issues with global/local models
* make ensure_picklable return given model
* remove ensure_picklable, use test_is_call_from_module only in generics
* reformat code after updating black==20.8b1
* move get_caller_module_name and is_call_from_module to generics
* apply suggestions from @samuelcolvin
* add tests for get_caller_module and is_call_from_module called from module
* fix linting
* fix path to modules in test_module fixture, capture stderr and stdout
* fix broken test module
* fix subprocess call for windows
* enhance create_module fixture, add run_as_module fixture
this will allow run modules in subprocess and define module code in functions-containers
* add test for redefined concrete model without cache
* add changes file
* remove unused variable
* rewrite tests with pytest.raises
* fix linting
* rewrite test_create_model_pickle and test_forward_ref_with_create_model with module definition in function
* Update create_model docstring
Co-authored-by: PrettyWood <em.jolibois@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
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>
* Add support for passing Configs to Dataclasses
* formatting and fixes
* move tests into dataclasses_config.py
* use inherit_config in create_model
fix#276
* Properly set Config in create_model
Set the Config attribute in create_model, so it is found by the
MetaModel.
* Black formatting fixes
* Remove uneeded validator logic
* Use single quotes
* Add return value to inherit_validators
* Refactor inherit_validators
* Add HISTORY.rst entry
* Address feedback
* Extend existing validator test cases and remove field aliasing
* Add test cases for validators inherted from parent
* Make test case names consistent with where validators are configured
* Add detail create_model validator inheritance tests
* Get rid of `track` in errors
* Move `display_as_type` func into utils module
* Get rid of error as `namedtuple`
* Renamed `Error.index` to `Error.loc`
* New way to get error type
* New way to get error message
* New errors format
* Renamed `flatten_errors` property to `flat_errors`
* `__slots__` for `Error` and `ValidationError`
* `loc` as `tuple`
* Tests
* Review fixes
* `flatten_errors` as generator