* Avoid some side effects of default factory
- by calling it only once if possible (fix#1491)
- by not setting the default value in the schema (fix#1520)
* refactor: ensure type is set when using default_factory
* Add right __init__ signature generation
* Add params overlay support for custom __init__, enhance tests
* Change fake_ini creation to solve AttributeError in cython
AttributeError: attribute '__code__' of 'cython_function_or_method' objects is not writable
Possible there's other attrs that cannot be set in cython, but can't check myself yet
* Cython compatibility, add __signature__, ignore non-identifiers fields
Moved tests to separate file
Moved __init__ creation to utils
* Remove # pragma: no cover
Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
* Fixed adding signature to doc, some compatibility fixes
* Changed None to tuple() for py3.8 compatibility
* Finally (hope so) fix issues with closure. Add new docstring each time
* coverage for UndefinedType
* Checking signature more simple and obvious way
* Changed doc caption to simple message, used Undefined, merge conflicts
* Compatibility with py3.6
* Add changes/ file
* Ah, that space... Reformatted and ready to go!
* Update pydantic/main.py
Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
* Update pydantic/main.py
Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
* Fix signature for properties declared as fields
* Sort imports
* Add comments
* Generate BaseModel signature instead of __init__ signature
* Fixed imports
* Minor improvements from review
* Add docs for model signature
* Delete unused imports
* Fix formatting in tests
* Remove inspect imports from top level
* Update docs/examples/models_signature.py
Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>
* Add missing import
* Remove notes from doc
* change hypothesis-auto mention to hypothesis
* Use None as slice end instead of len()
* tweak generate_model_signature
* improve docs
* Revert af3dd4d, add fields to custom init only if var_kw declared
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
* Implement Optional required, when creating a ModelField(required=True), make it persist
* Add test for nullable required
* Improve formatting of Undefined custom object
* Refactor field infer/creation with Undefined to make it idempotent
Needed for when _type_analysis is re-run in Generics
* Add PR changes
* Increment/update tests with code review
* Update/refactor Undefined implementation with code review
* Fix BoolUndefined as string type for mypy, not runtime
* Add docs about required Optional
* Add explicit tests for Any
* Apply code review requested changes
* move tests out of test_validators.py
* Add support for mapping types as custom root
* Incorporate feedback
* Add changes
* Incorporate feedback
* Add docs and tests
* Fix linting issue
* Incorporate more feedback
* Add more specific match
* 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
* 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
* 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
* moving docs to mkdocs
* transfering readme to md and more
* fixing build
* splitting usage.md
* improving schema.md and index.md
* fix make_history.rst
* models intro
* working on data conversation and required fields
* more fixes to models.md
* list all standard types supported
* list of pydantic types
* tweaks
* update links in code
* Apply suggestions from code review
incorporate @dmontagu's suggestions.
Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>
* Apply suggestions from code review
more missed suggestions.
Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>
* Apply suggestions from code review
more corrects.
* cleanup
* Field order warning
* fix and regenerate benchmarks
* format examples better, cleanup
* improve schema mapping table
* correct highlighting file types in schema.md
* add redirects in javascript
* add logo