* 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>
* fix: forward ref with nested models and optional fields
PR #1712 introduced a regression for forward refs in `ModelField.prepare`
as it would not return early for forward refs anymore.
Optional fields would hence have `required` set to `True`.
closes#1736
* test: skip python 3.6 as __future__.annotations is not defined
* starting validation_decorator
* correct skip_pre_38
* fix coverage and type hints
* mypy tests and move to class based decorator
* 3.6 fix, prevent duplicate github actions
* correct py 3.6 check
* better errors
* cleaner field names for args and kwargs
* add change and comments
* starting docs
* back to 3.7 for docs
* docs
* bump
* add async example and fix print indents
* allow type annotations as strings
* python 3.8 in docs
* rename Schema to Field
* add Schema function with deprecation warning
* mypy tests and other tweaks
* tweaks and cleanup
* Update pydantic/fields.py
Co-Authored-By: Sebastián Ramírez <tiangolo@gmail.com>
* new URL parsing, fix#603, fix#541
* AnyUrl parts and more tests
* more coverage and db DSNs
* remove DSN methods
* tests for urlstr
* remove debug
* make AnyStr a subtype of str
* fix with cython
* rearranging networking code
* allowing international domains, cleanup
* support international domains
* better URL builder
* allow underscores in subdomains and domains
* tests for json and schema, max length
* urlstr > stricturl
* updating docs
* tweak docs examples
* tweak docs