* 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
* 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>
* Generate docs exampels for Python 3.10 and above
Code quality is not great and main intent here is to show the result.
* Fix docs build on 3.9
* Build docs on 3.10
* What's Python 3.1?
* Create temp dir if not exists
* Refactor and improve imlementetion
* Keep runtime typing in examples
* Revert unrelated formatting changes
* Add changes file
* Allow specifying requirements in examples
* Pin autoflake and pyupgrade
* Add docs/build to Makefile lint/format/mypy
* ignore_missing_imports for ansi2html and devtools
* Add .tmp-projections to .gitignore
* Remove dont-upgrade now when Pattern is supported
* Update postponed evaluation examples
Co-authored-by: Samuel Colvin <s@muelcolvin.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>
* Change path in validation_decorator_types example to a relative path
* make the example a little clearer
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
* Add .venv/ to .gitignore
* Allow typecheckers to infer Json inner type
* Fix and improve mypy tests
* Add type tests
* Add Json[Any] case to schema test
* Update example in docs
* Add changes file
* Use <3.9 compatible annotations for tests
* feat: add to upper function for strings and bytes
* docs(changes): add message for change
* fix: add constr upper on types
* fix: add constr upper on types
* feat: add examples and doc usage
* test: add test to upper for types
* chore: apply suggestions from code review
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
* chore(docs): reorder `anystr_upper` to under `anystr_lower`
* fix(test): adjust parametrizes to constrained bytes upper
* refactor: use pytest parametrize for unify test constrained str upper
* refactor: use pytest parametrize for unify test constrained str lower
* refactor(test): use pytest parametrize for unify test any str upper
* refactor(test): use pytest parametrize for unify test any str lower
* refactor(test): use pytest parametrize for unify test constrained bytes lower
* refactor(test): use pytest parametrize for unify test any str strip whitespace
* refactor(test): change test signatures to improve readability
Co-authored-by: Hasan Ramezani <hasan.r67@gmail.com>
* Add CockroachDsn type
The CockroachDsn type supports the following dialects: cockroachdb,
cockroachdb+psycopg2 and cockroachdb+asyncpg. It's meant to be used in
conjunction with the cockroachdb sqlalchemy dialect, more information
can be found here:
https://github.com/cockroachdb/sqlalchemy-cockroachdb
* tweak change log
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
* updates to description of the fields option.
Update of the fields option for config to reflect the fact that it is not actually equivalent to the Field class, as I was having troubles understanting ehy I couldn't set default or default_factory.
* corrected typo
* correction
* fix typo
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
* add support for alias handling in validate_arguments
* add test for alias handling in validate_arguments
* add documentation on alias support for decorator
* bug fixed in the validate_argumen decorator documentation
* add changes README
* change in the documentation due to a drafting error
* Update changes/3019-MAD-py.md
Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
* more challenging tests
* run the format checker
* integration of empty string as alias
Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>