Commit Graph

1035 Commits

Author SHA1 Message Date
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
Tobi Lipede 429b439830 Allow for generation of a constrained float with multiple_of argument for hypothesis plugin (#2442)
* added method to generate a constrained float with multiple_of argument

* removed HealthCheck.filter_too_much

* Added change file

* fixes for case when min/max aren't provided; adding an extra test for float gt/lt with multiple of
2021-03-02 18:56:45 +00:00
Eric Jolibois a74232e101 fix: variable length tuples of compound types (#2421) 2021-03-02 12:09:31 +00:00
Eric Jolibois 37c37fd55e fix(mypy): fix custom Path and UUID related types (#2420)
* add tests that should pass

But we have those errors

226: error: Item "str" of "Union[UUID, str]" has no attribute "hex"  [union-attr]
227: error: Item "str" of "Union[UUID, str]" has no attribute "hex"  [union-attr]
228: error: Item "str" of "Union[Path, str]" has no attribute "absolute"  [union-attr]
229: error: Item "str" of "Union[Path, str]" has no attribute "absolute"  [union-attr]
230: error: Item "str" of "Union[Path, str]" has no attribute "absolute"  [union-attr]
231: error: Item "str" of "Union[Path, str]" has no attribute "absolute"  [union-attr]

* fix: right types should be valid

* remove new useless `type: ignore`

* docs: add change file
2021-03-02 12:07:07 +00:00
Eric Jolibois b2d3f333f0 refactor: set Pattern encoder in ENCODERS_BY_TYPE (#2444)
* refactor: set `Pattern` encoder in `ENCODERS_BY_TYPE`

* docs: add change file
2021-03-02 12:05:57 +00:00
nikhilraojl 9bd2da7805 fix: docs indentation (#2448)
* fix: docs indentation

* docs: last fixes indentation

Co-authored-by: PrettyWood <em.jolibois@gmail.com>
2021-03-02 10:33:50 +00:00
Eric Jolibois d619457066 fix: docs indent (#2440) 2021-03-01 15:45:06 +00:00
dependabot[bot] 8f5e89543d build(deps): bump mkdocs-material from 6.2.8 to 7.0.3 (#2430)
Bumps [mkdocs-material](https://github.com/squidfunk/mkdocs-material) from 6.2.8 to 7.0.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/6.2.8...7.0.3)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 15:41:46 +00:00
dependabot[bot] 6af7156c3b build(deps): bump coverage from 5.4 to 5.5 (#2432)
Bumps [coverage](https://github.com/nedbat/coveragepy) from 5.4 to 5.5.
- [Release notes](https://github.com/nedbat/coveragepy/releases)
- [Changelog](https://github.com/nedbat/coveragepy/blob/master/CHANGES.rst)
- [Commits](https://github.com/nedbat/coveragepy/compare/coverage-5.4...coverage-5.5)

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2021-03-01 15:41:32 +00:00
Eric Jolibois f9fe4aa086 fix: do not overwrite declared hash in subclasses of a model (#2423) 2021-02-27 15:42:53 +00:00
Samuel Colvin a8d50aef0c update license for 2021 2021-02-26 16:38:26 +00:00
Samuel Colvin aff4a41f9d preparing for v1.8 (#2414)
* preparing for v1.8 🎉 🚀

* change description for #2415

* tweak change descriptions

* fix nested lists in docs

* remove items in 1.7.3 from 1.8
2021-02-26 16:30:08 +00:00
Samuel Colvin 2ee6811655 remove DeprecationWarnings from v1 release & fix coverage (#2415)
* remove DeprecationWarnings from v1 release

* coverage on unpickling Undefined private attributes

* coverage on undefined in copy, allow Undefined to be pickled unchanged

* fix coverage of model._iter()
2021-02-26 14:43:47 +00:00
xppt 8f0980e982 fix: prevent RecursionError while using recursive GenericModels (#2338)
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
2021-02-26 10:30:12 +00:00
Samuel Colvin 90df33cf1e update benchmarks 2021-02-25 20:24:28 +00:00
Eric Jolibois 3ec35590f1 Support Field in dataclass + 'metadata' kwarg of dataclasses.field (#2384)
* Support `Field` in `dataclass` + `'metadata'` kwarg of `dataclasses.field`

Please enter the commit message for your changes. Lines starting

* add `__has_field_info_default__` for minimal effect on perf

* lower complexity of `_process_class`
2021-02-25 20:04:16 +00:00
Alvaro Leonel f32832ad8e Adds benchmark tests for Schematics tool (#2381)
* Adds benchmark tests for Schematics tool

* Removes the "to_json" method from the schematics benchmark tests

* Fixs exception check in the Schematics benchmark

* tweaks and cleanup

Co-authored-by: Alvaro Mariano <alvaro.mariano@br.experian.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2021-02-25 19:51:47 +00:00
Eric Jolibois ededd3ebf8 refactor(schema): support properly Literal in generated JSON schema (#2348)
* test: improve example

* refactor: use enum for Literal in JSON schema

* test: update test with new schema generation

* chore: add change file
2021-02-25 19:42:17 +00:00
Davis Kirkendall 2c2e238c19 Update mkdocs extensions to fix local syntax highlighting (#2401)
- Fixes #2400
2021-02-25 19:24:03 +00:00
Ofek Lev 4ddf4f14cd Properly retain types of Mapping subclasses (#2325)
* Properly retain types of Mapping subclasses

* Create 2325-ofek.md

* update with feedback

Co-Authored-By: Eric Jolibois <eric.jolibois@toucantoco.com>

* satisfy mypy?

* Update fields.py

Co-Authored-By: Eric Jolibois <eric.jolibois@toucantoco.com>

* show uncovered line numbers

* fix coverage

* update

* address feedback

* try

* update

Co-Authored-By: Eric Jolibois <eric.jolibois@toucantoco.com>

* rename test

* address feedback

Co-authored-by: Eric Jolibois <eric.jolibois@toucantoco.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2021-02-25 17:27:50 +00:00
Davis Kirkendall aa92db5e4f Add test for generic aliases and lenient_issubclass (#2392) 2021-02-25 17:08:21 +00:00
Alexander Hultnér eab9d05473 fix #2293: Properly encode Decimals without any decimal places. (#2294)
* fix #2293: Properly encode Decimals without any decimal places.

* doc: Added changelog entry.

* refactor: Move ConstrainedDecimal test from separate file into test_json

* docs: Remove prefix from changelog.

* test: Changed test_con_decimal_encode to @samuelcolvins recommendations
2021-02-24 11:50:23 +00:00
Alexander c8883e34db Added support for 13/19 digits VISA credit cards in PaymentCardNumber type (#2286)
* Added support for 13/19 digits VISA credit cards

* Added changes md-file

* Fixed tests VALID_VISA_19 length, changed constants order

* tiny tweaks

Co-authored-by: Alexander Plaxin <a.plaxin@qiwi.com>
Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
2021-02-23 12:13:25 +00:00
Tom Cobb 3f849a368f Support Field(default_factory) in validate_arguments (#2176)
* Support Field(default_factory) in validate_arguments

* Added docs for validate_arguments with Field
2021-02-23 12:07:11 +00:00
Eric Jolibois 7da04d95fa fix(mypy): remove complaints about most custom _pydantic_ types (#2099)
* fix(mypy): handle FilePath and DirectoryPath custom types

closes #2098

* fix(mypy): handle almost all other custom types

* remove mypy overwrite when extra logic is set

* fix unused mypy ignore
2021-02-23 12:05:42 +00:00