* working on core schema generation
* adapting main.py
* getting tests to run
* fix tests
* disable pyright, fix mypy
* moving to class-based model generation
* working on validators
* change how models are created
* start fixing test_main.py
* fixing mypy
* SelfType
* recursive models working, more tests fixed
* fix tests on <3.10
* get docs build to pass
* starting to cleanup types.py
* starting works on custom types
* working on using annotated-types
* using annoated types for constraints
* lots of cleanup, fixing network tests
* network tests passing 🎉
* working on types
* working on types and cleanup
* fixing UUID type, restructing again
* more types and newer pydantic-core
* working on Iterable
* more test_types tests
* support newer pydantic-core, fixing more test_types.py
* working through more test_types.py
* test_types.py at last passing locally 🎉
* fixing more tests in test_types.py
* fix datetime_parse tests and linting
* get tests running again, rename to test_datetime.py
* renaming internal modules
* working through mypy errors
* fixing mypy
* refactoring _generate_schema.py
* test_main.py passing
* uprev deps
* fix conftest and linting?
* importing Annotated
* ltining
* import Annotated from typing_extensions
* fixing 3.7 compatibility
* fixing tests on 3.9
* fix linting
* fixing SecretField and 3.9 tests
* customising get_type_hints
* ignore warnings on 3.11
* spliting repr out of utils
* removing unused bits of _repr, fix tests for 3.7
* more cleanup, removing many type aliases
* clean up repr
* support namedtuples and typeddicts
* test is_union
* removing errors, uprev pydantic-core
* fix tests on 3.8
* fixing private attributes and model_post_init
* renaming and cleanup
* remove unnecessary PydanticMetadata inheritance
* fixing forward refs and mypy tests
* fix signatures, change how xfail works
* revert mypy tests to 3.7 syntax
* correct model title
* try to fix tests
* fixing ClassVar forward refs
* uprev pydantic-core, new error format
* add "force" argument to model_rebuild
* Apply suggestions from code review
Suggestions from @tiangolo and @hramezani 🙏
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
* more suggestions from @tiangolo
* extra -> json_schema_extra on Field
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
* Remove Cython
* fix CI
* fix coverage
* fix tests
* switching to pypyroject.toml
* pre-commit all and use pre-commit for linting
* no mypy tests on macos and windows on ci, use flake8-pyproject
* fix docs and tests CI
* check build is working
* drop pytest-cov
* window and macos ci with 3.11, reduce filtering
* use pip-tools to pin all dependencies
* fix docs and fastapi tests
* fix test deps for 3.7
* no cache on tests job
* revert fastapi changes, fix coverage
* fix mypy coverage
* test with older mypy
* dotenv not required for mypy tests
* split testing requirements std and extra
* typo
* @PrettyWood comments
* correct branch name
* mypy python_version and pr template
* add test for create_model with slots
* add test for create_model with slots
* add warning and change description
* fix flakey none tests on 3.8.10
* avoid flakey coverage changes
* Fix#1458 - Allow for custom parsing of environment variables via env_parse
* Add docs for env_parse usage
* Add changes file for #3977
* fixup: remove stray print statement
* Revert env_parse property on field
* Add parse_env_var classmethod in nested Config
* Update documentation for parse_env_var
* Update changes file.
* fixup: linting in example
* Rebase and remove quotes around imported example
* fix example
* my suggestions
* remove unnecessary Field(env_parse=_parse_custom_dict)
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
* ✨ Add JSON-compatible float constraints for NaN and Inf
* switching to a single "allow_inf_nan"
* fix tests
* add change and docs
* add allow_inf_nan to Config
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
* Fix `AnyUrl.build` doesn't do percent encoding (#3061)
please review
* Use `urllib.parse` instead of custom implementation for percent encoding
* Make `quote_plus` a `stricturl` option
* Add docs for `stricturl(quote_plus=True)`
* Better changes message for #3061
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
* Fix precent encoding version note to V1.10
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
* Fix `Building URLs` snippit markdown
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
* Fix formatting for `docs/examples/types_url_building.py`
* fix docs
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
* feat: Make SecretStr hashable
* docs: Add change documentation
* test: Assert that the hash of SecretStr is an integer value
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
* feat: Make SecretBytes hashable
Co-authored-by: Johannes Rueschel <johannes.rueschel@telekom.de>
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
* Initial implmenetation of ConstrainedDate, condate, with tests and docs
* Attempt at fixing hypothesis tests for ConstrainedDate. Suspect still not working
* removed forgotten breakpoint() :(
* suggested changes to pydantic/_hypothesis_plugin.py for condate etc
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
* - fixed import for hypothesis tests
* - linting fixes only
* - more fixes for linting
* changes following review by samuelcolvin 2022-08-08. Will rebase next
* - added changes to changes file
* fixed changes file filename to PR #3740
* additional changes requested by samuelcolvin 2022-08-11: add test for schema_json, add hypothesis test, etc
* make test_json_schema compare to a dictionary rather than json string
* added test_date_constrained_types to test_schema
* rewrite tests
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
* generate history from changes, uprev
* Pydantic V2 blog (#4218)
* first draft of pydantic V2 blog
* more blog
* blog rendering and formatting
* more section
* completing conversion table
* prompt build
* reviewing blog post
* more reviewing and extending
* recommendations from @Rabscuttler and @PrettyWood
* add implementation details and more suggestions
* comment about breaking changes
* convert namespae to table, more removals
* Apply suggestions from code review by @tiangolo
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
* feedback from @tiangolo's review
* changes from @adriangb's review
* Apply suggestions from code review
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
* convert namespace info to psuedo-code
* rename property, remove schema_json()
* adding validation context
* remove 'model_schema_json', take 2
* more tweaks while reviewing
* comment about pypy and tagged unions
* add thanks :prey:, prepare for release
* suggestions from @PrettyWood
* suggestions from @PrettyWood, model_dump_json comment
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
* comments mostly from @PrettyWood (#4226)
* comments mostly from @PrettyWood
* add updated comment
* fix pre-commit
* allow for shallow copies (#4093)
* allow for shallow copies
* Add changes file
* tweak change
* update for comments
* rename attr
* use single quotes
* bump ci
* add warning if not a string, switch to string literals
* fix linting, prompt ci
* fix ci
* extend and fix tests
* change default to "shallow"
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
* uprev and prepare for release
* linting
Co-authored-by: Sebastián Ramírez <tiangolo@gmail.com>
Co-authored-by: Zac Hatfield-Dodds <zac.hatfield.dodds@gmail.com>
Co-authored-by: Tim Paine <t.paine154@gmail.com>
* Allow BaseModel to have fields of type Type
* update
* minor update
* update tests
* update
* fix type
* update
* Update changes/4051-aminalaee.md
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
* Fix a bug where BaseModel.construct would not appropriately respect field aliases
* Perhaps do not raise on construct and just apply the fix
* Fix quotes and remove check on allow_population_by_field_name
* Fix lint
* Fix lint, remove bad arg
* Black formatted
* Mmmm black formatter and single quotes linting, what a world
* Added change file
* PR feedback
Co-authored-by: Kyle Amos <kamos@seatgeek.com>