Commit Graph

530 Commits

Author SHA1 Message Date
Samuel Colvin e071a3e368 remove repeat newline in docs (again) (#4545) 2022-09-20 14:19:33 +00:00
Samuel Colvin c3e3fafae0 remove repeat newline in docs (#4544) 2022-09-20 14:01:22 +00:00
Samuel Colvin e0b8e0530b tiny tweak to docs (#4543) 2022-09-20 14:48:59 +01:00
Dmitry Lavrentev 996101b8ba fix: missing file extension in model_config.md link (#4512) 2022-09-13 09:39:31 +02:00
Samuel Colvin 85e4596958 Move settings to pydantic-settings (#4492)
* Move settings to pydantic-settings

* fix docs, remove dotenv

* fix coverage

* removing unused test fixture
2022-09-07 13:05:51 +01:00
Samuel Colvin f341049b9e Remove Cython & Move to pyproject.toml (#4473)
* 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
2022-09-06 17:15:51 +01:00
Samuel Colvin a4367c1c58 Revert percent encoding in URLs. (#4470)
* Revert "Fix `AnyUrl.build` doesn't do percent encoding (#3061) (#4224)"

This reverts commit e34ff9255f.

* change and warning
2022-09-05 11:02:43 +01:00
dependabot[bot] 2add8a9482 build(deps): bump hypothesis from 6.54.3 to 6.54.4 (#4464)
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.54.3 to 6.54.4.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.54.3...hypothesis-python-6.54.4)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 23:49:06 +02:00
dependabot[bot] f1fb4f20b4 build(deps): bump mkdocs-material from 8.4.0 to 8.4.2 (#4463)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 8.4.0 to 8.4.2.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/8.4.0...8.4.2)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 23:48:47 +02:00
dependabot[bot] 85cd9ff5d1 build(deps): bump autoflake from 1.4 to 1.5.3 (#4462)
Bumps [autoflake](https://github.com/PyCQA/autoflake) from 1.4 to 1.5.3.
- [Release notes](https://github.com/PyCQA/autoflake/releases)
- [Commits](https://github.com/PyCQA/autoflake/compare/v1.4...v1.5.3)

---
updated-dependencies:
- dependency-name: autoflake
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-09-01 23:48:25 +02:00
Samuel Colvin b065908490 fix type hints in BaseSettings.Config (#4450)
* fix type hints in BaseSettings.Config

* add tests and change notice
2022-08-30 13:08:23 +01:00
Samuel Colvin 4832ae9acd add Explosion AI and AWS to sponsors (#4413)
* add Explosion AI and AWS to sponsors

* rename "Explosion AI" to "Explosion"

Co-authored-by: Ines Montani <ines@ines.io>

Co-authored-by: Ines Montani <ines@ines.io>
2022-08-23 10:29:36 +00:00
Grant Murray 9d2e1c40cb patch/typo-in-pydantic-v2-docs (#4422)
Change a single word in the Pydantic v2 documentation (should be `unchanged`, no?)
2022-08-23 09:41:58 +02:00
Samuel Colvin dd5f2a55aa fix links 2022-08-22 22:32:56 +01:00
Samuel Colvin 5b2bcfd73c correct copy_on_model_validation docs (#4420)
* correct "copy_on_model_validation" docs, fix #4369

* Update docs/usage/model_config.md

* correct docs
2022-08-22 22:00:18 +01:00
Anthony Miyaguchi fe7c9da6c1 Fix #1458 - Allow for custom parsing of environment variables via parse_env_var in Config object (#4406)
* 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>
2022-08-22 16:06:14 +00:00
Sebastián Ramírez 8dade7e9ac Add JSON-compatible float constraints for NaN and Inf (#3994)
*  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>
2022-08-22 15:21:56 +01:00
Hasan Ramezani abcf81ec10 Rename master to main (#4405) 2022-08-19 18:49:13 +01:00
dependabot[bot] 4c37e662e3 build(deps): bump hypothesis from 6.54.1 to 6.54.3 (#4403)
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.54.1 to 6.54.3.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.54.1...hypothesis-python-6.54.3)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-19 10:27:30 +00:00
dependabot[bot] 98a35fdb18 build(deps): bump mkdocs-material from 8.3.9 to 8.4.0 (#4401)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 8.3.9 to 8.4.0.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/CHANGELOG)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/8.3.9...8.4.0)

---
updated-dependencies:
- dependency-name: mkdocs-material
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-19 10:11:08 +00:00
Fares Ahmed e34ff9255f Fix AnyUrl.build doesn't do percent encoding (#3061) (#4224)
* 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>
2022-08-19 09:20:20 +00:00
commonism 78e84b92c0 update links to https://github.com/pydantic/… (#4398)
Co-authored-by: Markus Koetter <koetter@cispa.de>
2022-08-19 07:46:58 +01:00
Samuel Colvin 2f883b9509 fix pattern matching version, ref #3921 (#4384) 2022-08-16 22:29:59 +01:00
rafael 7344374dd0 BaseModel: Document and test structural pattern matching (#3921)
* BaseModel: Add __match_args__ attribute to namespace

* changelog

* amend docs

* add tests

* Update changes/3920-irgolic.md

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>

* Update .github/workflows/ci.yml

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>

* rename test_match => test_structural_pattern_matching

* pytest.skip => pytest.mark.skipif

* Revert "BaseModel: Add __match_args__ attribute to namespace"

This reverts commit 79367356fddac90b047b10620dc895425ec25b40.

* adjust tests for kwarg only structural pattern matching

* adjust docs for kwarg only pattern matching

* changes: Support => Document

* fix docs?

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
2022-08-16 08:47:17 +02:00
Hasan Ramezani 4e7878932c Update Python version in contributing doc (#4376) 2022-08-14 20:57:03 +00:00
Hasan Ramezani c5d57b7cf5 Fix the behavior change in .json() documentation (#4371)
* Fix the behavior change in `.json()` documentation

* Add breaking change to original change in HISTORY.md
2022-08-14 17:46:24 +00:00
Samuel Colvin cc68900274 Build binaries for Python 3.11 (#4374)
* build binaries for python 3.11

* add change

* [skip ci] revert CI if comment

* add 3.11 to pypi classifiers
2022-08-14 18:32:33 +01:00
Arseny Boykov c24d33e5f1 Generate docs exampels for Python 3.10 and above (#4339)
* 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>
2022-08-14 17:21:53 +01:00
hottwaj cdd091c8ac Initial implementation of ConstrainedDate, condate (#3740)
* 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>
2022-08-12 14:37:41 +00:00
Kyungmin Lee 0320a99361 feat: add support multiple dotenv files (#1497) (#3222)
* feat: support multiple dotenv files

Allow BaseSettings to accept multiple dotenv files in Config as a list
or tuple.

* docs: add multiple dotenv support

* docs: add a change summary

* test: add missing tests

* fix: test coverage

* refactor: raise a TypeError when an object of an invalid type is passed

* fix: a lint error

* refactor: remove `_read_process_env_vars` method

* docs: update priority

* refactor: apply a review

* test: simplify testing

* refactor: apply reviews

* reverse piority order, reduce diff size

* fix change file grammar

* correct docs, avoid unnecessary copy of os.environ

* correct wording in docs

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2022-08-12 12:17:01 +00:00
Samuel Colvin 47362e33b6 Pick 1.9 (#4350)
* 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>
2022-08-12 11:09:49 +01:00
Samuel Colvin 5c8942bdd4 Revert "Add nested json encoding (#3941)" (#4367)
This reverts commit b42fae081c.
2022-08-12 11:08:33 +01:00
Hasan Ramezani 697459a73d Change path in validation_decorator_types example to a relative path (#4341)
* 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>
2022-08-09 11:12:05 +00:00
Arseny Boykov 0500610ec5 Typecheck Json inner type (#4332)
* 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
2022-08-09 11:49:27 +01:00
Hasan Ramezani a9c273235f Fix sub-model link in usage/models docs (#4234) 2022-08-09 10:51:52 +01:00
Gustavo Satheler d90def3c4e Add to upper function for strings and bytes (#4165)
* 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>
2022-08-08 17:06:00 +01:00
Amin Alaee 65a1381591 Fix schema for set and frozenset with default value (#4155)
* Fix schema for Set with default value

* add changelog

* Add frozenset to schema mapping docs
2022-08-08 17:02:04 +01:00
Lily Wang b42fae081c Add nested json encoding (#3941)
* add nested json encoding

* fix timezones

* add changes doc

* split tests and rename example

* Update changes/3941-lilyminium.md

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>

* split tests into functions

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2022-08-08 15:46:51 +00:00
Tiemo cf16f7c388 Add CockroachDsn type (#3830)
* 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>
2022-08-08 15:14:35 +00:00
gieddy660 9599a3d256 updates to description of the fields option. (#3822)
* 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>
2022-08-08 14:53:43 +00:00
Mateo Aguirre Duque 7431683e88 Alias support in decorator validate_arguments (#3019)
* 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>
2022-08-08 13:33:51 +01:00
Yasser Tahiri e07d73b373 Update URLs after migrating to organization (#4348)
* update URLs

* add a change file
2022-08-08 12:27:35 +00:00
Luca Repetti 460f858cc5 Add mypy static checking for default and default_factory (#3430)
* Add static checking for default and default_factory

* Describe PR change

* Remove unnecessary booleans default_specified and default_factory_specified

* Add test with default without Field

* Apply suggestions from code review

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>

* Fix tests

* Add handling of Overload types for mypy0.971

* Avoid to use walrus operator

* Support mypy 0.910 for overloaded types

* Increase coverage for mypy plugin

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2022-08-08 13:07:23 +01:00
dependabot[bot] b67c77f71a build(deps): bump flake8 from 5.0.3 to 5.0.4 (#4347)
Bumps [flake8](https://github.com/pycqa/flake8) from 5.0.3 to 5.0.4.
- [Release notes](https://github.com/pycqa/flake8/releases)
- [Commits](https://github.com/pycqa/flake8/compare/5.0.3...5.0.4)

---
updated-dependencies:
- dependency-name: flake8
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-08 12:05:27 +00:00
dependabot[bot] ae3aae9763 build(deps): bump hypothesis from 6.53.0 to 6.54.1 (#4345)
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.53.0 to 6.54.1.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.53.0...hypothesis-python-6.54.1)

---
updated-dependencies:
- dependency-name: hypothesis
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-08-08 13:02:46 +02:00
PattyC d0e5f98be4 new to_lower_camel() function (#3473)
* Create utils.py

I needed non pascal case camel case support

* write tests for new `to_lower_camel()` function

* Create 3463-schlerp.md

* added mention to to_lower_camel()

* changed quotes to single tick

* adding second blank line at end of file.

* again, adding second blank line...

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2022-08-05 14:18:19 +00:00
Piotr Rogulski 5885e6ce12 fix(PostgresDsn): Add support for multiple hosts in PostgresDsn #3337 (#3349)
* Move host regex out of url_regex and inject it afterwards

* Add new host regex with cache variable

* Move url regex strings to separate variables

* Add new postgres url regex with cache variable

* Add tests for failed postgres dns with many hosts

* Add new parts type: HostParts

* Add new slot 'hosts' to PostgreDsn and update init with it

* Add validators to PostgreDsn class.

When multiple hosts are found, all hosts will be store in hosts list. To
keep back compatibility single host will return all data as previously
in main params.

* Add more detail tests to check multi host postgres dsn with attributes

* Add changes description in the file

* Delete usless comments to regex strings because of varable names

* Add missing docstring to postgres_url_regex function

* Update postgre dsn with AnyUrl.slots

* Update AnyUrl.validate_parts to support disabling port validation

* Reuse _host_regex in postgres_url_regex

* Fix typing

* Delete not needed group in regex

* Improve tests by adding parametrize to postgreDsn tests

* Update postgres regex to not validate hosts in it

* Delete duplicated code and use shared validate method

* Move multi host methods into separate class and inherit it in the postgreDsn

* fix tests

* tweaks and re order code

* add a note to docs

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2022-08-05 13:57:16 +00:00
Salar Nosrati-Ershad d53259aa58 Add MongoDB network data source name (DSN) schema (#3230)
* Add MongoDsn to pydantic.networks with allowed_schemas and get_default_parts

* Add unit test to MongoDsn and remove default host from default parts becouse it's required by MongoDB protocol

* Fix import issues, follow contributing guide

* Add changes to docs

* Add changes to changelog
2022-08-04 16:10:42 +01:00
Will McGugan e58dad6dec Added support for Rich Repr protocol (#3099)
* Added support for Rich Repr protocol

* restore line

* Words

* quotes

* Update changes/3099-willmcgugan.md

Adds code to markdown

Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>

* added usage with Rich

Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2022-08-04 13:47:42 +00:00
Eric Jolibois 576e4a3a8d refactor: change pydantic dataclass decorator (#2557)
* refactor: rewrite the whole pydantic dataclass logic

* test: add tests for issue 2162

* test: add tests for issue 2383

* test: add tests for issue 2398

* test: add tests for issue 2424

* test: add tests for issue 2541

* test: add tests for issue 2555

* refactor: polish

* change default and support 3.6

* fix coverage

* fix mypy and text

* typos

* test: add tests for issue 2594

* fix: forward doc for schema description

* add change

* chore: small changes from review

* refactor: avoid extra __pydantic_run_validation__ parameter

* small tweaks

* remove wrapper

* support 3.6

* fix: mypy

* rewrite doc

* add docs

* wrapper is removed now

* a bit more docs

* code review

* faster dict update

* add test for issue 3162

* add test for issue 3011

* feat: add `Config.post_init_after_validation`

* allow config via dict

* fix cython and TypedDict

* chore: typo

* move `compiled` in `version.py`

* refactor: switch from `Config.post_init_after_validation` to \'post_init_call`

* add dataclass isinstance support

* avoid multi paragraphs in change file

* feat: support `Config.extra`

* refactor: simplify a bit code

* refactor: avoid creating useless functions

* refactor: simplify `is_builtin_dataclass`

* support extra in post_init

* docs: add warning on config extra

* fix #3713 compatibility

* update docs

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2022-08-04 12:06:54 +01:00