* Add tests
* Fix the issue
* Add changes file
* Improved convert_generics
* Add default fallback to convert_generics
Improved Annotated and Literal handling
* Fix Cython doesn't support generic types (PEP560)
Watch cython issue cython/cython#2753
Previous implementation can be used after cython 3.0 release
* Add custom type test
* Cosmetic fixes
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
* Fix typos
* Add SelfReferencing test validation
Add parametrization to
* Fix: parametrization caused test discovery problem
* Better explanation for a test case
* Better assertions for model creation tests
* Rerun CI
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
* apply update_forward_refs to json_encoders, fix#3583
* linting
* mypy
* avoid use of ForwardRef with python3.6
* fix ForwardRef usage, take 2
* coverage
* Try to evaluate forward refs after model created
* Upadate docs and remove code duplication
* Update changes/2588-uriyyo.md
Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
* Update docs/usage/postponed_annotations.md
Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
* Remove unused import
Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
* fix: resolve forward refs for inherited dataclasses
closes#1668
* chore: add change file
* fix: make test work everywhere
* chore: rename file just in case
As it doesn't solve the target issue, let's change the PR number
* docs: update change description
* 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