Commit Graph

1059 Commits

Author SHA1 Message Date
Søren Bjerregaard Vrist 08fc8302cf Add lookahead for ip check in AnyUrl (#2512) 2021-05-09 10:49:19 +01:00
Eric Jolibois 9cc19e9a8e fix: support arbitrary types with custom __eq__ (#2502) 2021-05-09 10:44:53 +01:00
Koudai Aono 07908b3846 Add "strict" argument to "conbytes" (#2490)
* Add "strict" argument to "conbytes"

* Add unittest

* Update changes/2489-koxudaxi.md

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

Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
2021-05-09 10:27:29 +01:00
Alexandre Gerona 9f654a1fb2 fix(encoder): serialize NameEmail to str (#2479) 2021-05-09 10:26:02 +01:00
Danielle Madeley 82fb6ebfc9 Generate schema for generic models (#2364) 2021-05-09 09:23:56 +01:00
Samuel Colvin 5921d5ec96 use latest label-and-assign docker image 2021-05-03 22:03:58 +01:00
Samuel Colvin c7aea15d2a remove unused step from label-and-assign 2021-05-03 18:17:44 +01:00
Samuel Colvin 298a54a024 add label-and-assign github action (#2739)
* add label-and-assign github action

* remove pull_request_review trigger :-(
2021-05-03 18:12:06 +01:00
krisaoe 42395056e1 Fix(docs): remove colon to separate unrelated clauses (#2733)
* Fix(docs): remove colon to separate unrelated clauses 

The colon at the end of the line "The fields which were supplied when user was initialised:" suggests that the code following it is related.
Changed it to a period.

* Include change summary readme.
2021-05-03 17:46:37 +01:00
dependabot[bot] 55e688a30d build(deps): bump black from 20.8b1 to 21.4b0 (#2700)
Bumps [black](https://github.com/psf/black) from 20.8b1 to 21.4b0.
- [Release notes](https://github.com/psf/black/releases)
- [Changelog](https://github.com/psf/black/blob/master/CHANGES.md)
- [Commits](https://github.com/psf/black/commits)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2021-05-03 17:19:58 +01:00
dependabot[bot] d9cf604786 build(deps): bump pytest-mock from 3.5.1 to 3.6.0 (#2734)
Bumps [pytest-mock](https://github.com/pytest-dev/pytest-mock) from 3.5.1 to 3.6.0.
- [Release notes](https://github.com/pytest-dev/pytest-mock/releases)
- [Changelog](https://github.com/pytest-dev/pytest-mock/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest-mock/compare/v3.5.1...v3.6.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-03 17:19:36 +01:00
dependabot[bot] 50ade2fa3a build(deps): bump python-dotenv from 0.17.0 to 0.17.1 (#2736)
Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 0.17.0 to 0.17.1.
- [Release notes](https://github.com/theskumar/python-dotenv/releases)
- [Changelog](https://github.com/theskumar/python-dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/theskumar/python-dotenv/compare/v0.17.0...v0.17.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-03 17:18:28 +01:00
Samuel Colvin 26faf8ab94 add token permissions to upload-previews 2021-05-02 11:54:04 +01:00
dependabot[bot] 157e115500 build(deps): bump hypothesis from 6.8.5 to 6.10.1 (#2728)
Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.8.5 to 6.10.1.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.8.5...hypothesis-python-6.10.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-01 17:22:18 +01:00
Davis Kirkendall db697cc799 Add exclude as field parameter (#2231)
* Add exclude/include as field parameters

- Add "exclude" / "include" as a field parameter so that it can be
  configured using model config (or fields) instead of purely at
  `.dict` / `.json` export time.
- Unify merging logic of advanced include/exclude fields
- Add tests for merging logic and field/config exclude/include params
- Closes #660

* Precompute include/exclude fields for class

* Increase test coverage
* Remove (now) redundant type checks in Model._iter: New
  exclusion/inclusion algorithms guarantee that no sets are passed further down.

* Add docs for advanced field level exclude/include settings

* Minimal optimization for simple exclude/include export

Running benchmarks this vs. master is at:

this: pydantic best=33.225μs/iter avg=33.940μs/iter stdev=1.120μs/iter version=1.7.3
master: pydantic best=32.901μs/iter avg=33.276μs/iter stdev=0.242μs/iter version=1.7.3

* Apply review comments on exclude/enclude field arguments

* Fix/simplify type annotations
* Allow both ``True`` and ``Ellipsis`` to be used to indicate full field
  exclusion
* Reenable hypothesis plugin (removed by mistake)
* Update advanced include/include docs to use ``True`` instead of ``...``

* Move field info exclude/include updates into FieldInfo class

This way, the model field object does not need to concern itself with
dealing with field into specific fields.
(Same was done for alias in a previous commit).

* remove double back tick in markdown.

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
2021-05-01 16:45:37 +01:00
dependabot[bot] 822be39021 build(deps): bump cython from 0.29.22 to 0.29.23 (#2684)
Bumps [cython](https://github.com/cython/cython) from 0.29.22 to 0.29.23.
- [Release notes](https://github.com/cython/cython/releases)
- [Changelog](https://github.com/cython/cython/blob/master/CHANGES.rst)
- [Commits](https://github.com/cython/cython/compare/0.29.22...0.29.23)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-01 16:09:13 +01:00
dependabot[bot] a7fe5ea201 build(deps): bump mkdocs-material from 7.1.0 to 7.1.3 (#2699)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 7.1.0 to 7.1.3.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/docs/changelog.md)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/7.1.0...7.1.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-01 16:08:19 +01:00
dependabot[bot] d34ea05f60 build(deps): bump flake8 from 3.9.0 to 3.9.1 (#2682)
Bumps [flake8](https://gitlab.com/pycqa/flake8) from 3.9.0 to 3.9.1.
- [Release notes](https://gitlab.com/pycqa/flake8/tags)
- [Commits](https://gitlab.com/pycqa/flake8/compare/3.9.0...3.9.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-05-01 16:06:54 +01:00
Yurii Karabas 5261fd05a0 Add missed assert statement (#2662) 2021-04-12 22:55:28 +02:00
Edd Salkield ae13be5b8c docs: minor typo correction (#2649) 2021-04-10 11:21:51 +02:00
Eric Jolibois 14f055e743 fix(docs): url schema -> scheme (#2634) 2021-04-05 15:36:21 +02:00
wackazong 7fb77a779a Documentation: Put examples for config to the start of the section (#2615)
* Put examples to the start of the section

I think this is where they belong, they were in the middle of the list of config options somewhere near the end.

* Add "options" in table of contents

* tweak

Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
2021-04-05 12:40:13 +02:00
dependabot[bot] 22ba2ca21a build(deps): bump hypothesis from 6.3.4 to 6.8.5 (#2624)
* build(deps): bump hypothesis from 6.3.4 to 6.8.4

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.3.4 to 6.8.4.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.3.4...hypothesis-python-6.8.4)

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

* fix mypy issues

* build(deps): bump hypothesis from 6.8.4 to 6.8.5

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: PrettyWood <em.jolibois@gmail.com>
2021-04-05 12:19:17 +02:00
dependabot[bot] 39fd02e065 build(deps): bump mkdocs-material from 7.0.6 to 7.1.0 (#2632)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 7.0.6 to 7.1.0.
- [Release notes](https://github.com/squidfunk/mkdocs-material/releases)
- [Changelog](https://github.com/squidfunk/mkdocs-material/blob/master/docs/changelog.md)
- [Commits](https://github.com/squidfunk/mkdocs-material/compare/7.0.6...7.1.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 12:14:07 +02:00
dependabot[bot] 3003c6db13 build(deps): bump pytest from 6.2.2 to 6.2.3 (#2631)
Bumps [pytest](https://github.com/pytest-dev/pytest) from 6.2.2 to 6.2.3.
- [Release notes](https://github.com/pytest-dev/pytest/releases)
- [Changelog](https://github.com/pytest-dev/pytest/blob/main/CHANGELOG.rst)
- [Commits](https://github.com/pytest-dev/pytest/compare/6.2.2...6.2.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 12:10:28 +02:00
dependabot[bot] a12ea999d5 build(deps): bump isort from 5.7.0 to 5.8.0 (#2558)
Bumps [isort](https://github.com/pycqa/isort) from 5.7.0 to 5.8.0.
- [Release notes](https://github.com/pycqa/isort/releases)
- [Changelog](https://github.com/PyCQA/isort/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/pycqa/isort/compare/5.7.0...5.8.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 12:07:42 +02:00
dependabot[bot] ada1dd107b build(deps): bump twine from 3.3.0 to 3.4.1 (#2559)
Bumps [twine](https://github.com/pypa/twine) from 3.3.0 to 3.4.1.
- [Release notes](https://github.com/pypa/twine/releases)
- [Changelog](https://github.com/pypa/twine/blob/master/docs/changelog.rst)
- [Commits](https://github.com/pypa/twine/compare/3.3.0...3.4.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Eric Jolibois <em.jolibois@gmail.com>
2021-04-05 11:37:50 +02:00
Joe 282d5b847d Fix indent level of "Validating the first value" (#2577) 2021-04-05 11:30:30 +02:00
dependabot[bot] 300ebbb21a build(deps): bump pyflakes from 2.3.0 to 2.3.1 (#2591)
Bumps [pyflakes](https://github.com/PyCQA/pyflakes) from 2.3.0 to 2.3.1.
- [Release notes](https://github.com/PyCQA/pyflakes/releases)
- [Changelog](https://github.com/PyCQA/pyflakes/blob/master/NEWS.rst)
- [Commits](https://github.com/PyCQA/pyflakes/compare/2.3.0...2.3.1)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 11:26:36 +02:00
William Woodruff ec1bf696e9 doc(schema): fix a callout (#2620)
* doc(schema): use boldface to highlight a note

* doc(schema): fix small formatting typo

* doc(schema): attempt to fix the callout

* docs(schema): indent the callout
2021-04-05 11:25:32 +02:00
Dmitry 55ae199fd4 Update install.md (#2626)
There must be a typo here - two external dependencies, not three.
2021-04-05 11:19:55 +02:00
dependabot[bot] cb08c66655 build(deps): bump python-dotenv from 0.15.0 to 0.17.0 (#2629)
Bumps [python-dotenv](https://github.com/theskumar/python-dotenv) from 0.15.0 to 0.17.0.
- [Release notes](https://github.com/theskumar/python-dotenv/releases)
- [Changelog](https://github.com/theskumar/python-dotenv/blob/master/CHANGELOG.md)
- [Commits](https://github.com/theskumar/python-dotenv/compare/v0.15.0...v0.17.0)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-04-05 11:16:06 +02:00
Samuel Colvin 7416012227 remove test code 🙈 2021-04-02 18:16:02 +01:00
Samuel Colvin fd1a838551 fix previews using workflow_run 2021-04-02 17:43:18 +01:00
Samuel Colvin 15c0ba5242 correct usage of workflow_run actions 2021-04-01 20:46:30 +01:00
Samuel Colvin e921d5b852 fix docs-upload.yml 2021-04-01 20:41:33 +01:00
Samuel Colvin cd404f9340 switch to use workflow_run event in actions 2021-04-01 20:30:05 +01:00
Samuel Colvin e68c277afe avoid using pull_request_target 2021-04-01 17:57:25 +01:00
Samuel Colvin 368f014080 use pull_request_target on docs preview 2021-04-01 16:37:57 +01:00
Samuel Colvin 57377cf846 use "pull_request_target" in ci 2021-04-01 13:10:49 +01:00
Samuel Colvin 5b237b3ea6 coverage badge link 2021-03-27 21:33:59 +00:00
Samuel Colvin 91a8ddcbdd fix coverage badge 2021-03-27 19:42:47 +00:00
Samuel Colvin 908257914c docs preview and coverage using smokeshow (#2580)
* docs preview using smokeshow

* switch to using smokeshow for coverage

* fix macos and windows builds

* correct coverage prep.

* tweak coverage build logic

* print more coverage info

* mess with coverage setup, set config [PATHS]

* updating badges

* add context to coverage reports

* adding smokeshow status context
2021-03-27 18:36:52 +00:00
Samuel Colvin 7b7e70557b trying to fix fastapi tests (#2584)
* trying to fix fastapi tests

* try with 3.8 :-(

* try pinning sqlalchemy
2021-03-26 14:00:32 +00:00
Eric Jolibois 4ec6c52905 build(dev-deps): bump lint and doc deps (#2529) 2021-03-15 10:40:05 +01:00
dependabot[bot] d723b25cc0 build(deps): bump hypothesis from 6.3.0 to 6.3.4 (#2431)
* build(deps): bump hypothesis from 6.3.0 to 6.3.4

Bumps [hypothesis](https://github.com/HypothesisWorks/hypothesis) from 6.3.0 to 6.3.4.
- [Release notes](https://github.com/HypothesisWorks/hypothesis/releases)
- [Commits](https://github.com/HypothesisWorks/hypothesis/compare/hypothesis-python-6.3.0...hypothesis-python-6.3.4)

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

* fix: mypy lint

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: PrettyWood <em.jolibois@gmail.com>
2021-03-15 10:22:45 +01:00
Samuel Colvin 619ff261c9 prepare for v1.8.1 2021-03-03 17:03:59 +00:00
Samuel Colvin 62bb2ad492 allow Config.field to update a Field (#2461)
* allow Config.field to update a Field, fix #2426

* move logic to update_from_config, work with Annotated

* fix flake8 erroneous warnings

* test for allow_mutation

* better support for allow_mutation
2021-03-03 16:52:37 +00:00
Eric Jolibois 3f84d1405e fix: validation with a BaseModel field and a custom root type (#2451) 2021-03-03 10:47:58 +00:00
Eric Jolibois ab691142b5 fix: avoid RecursionError when using some types like Enum or Literal with generic models (#2438)
* fix: support properly `Enum` when combined with generic models

* whitelist iterables

* update change description

* add test for Literal

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2021-03-03 09:25:23 +00:00