Commit Graph

33 Commits

Author SHA1 Message Date
dependabot[bot] 52889203ac Bump devtools from 0.6.0 to 0.6.1 (#2037)
* Bump devtools from 0.6.0 to 0.6.1

Bumps [devtools](https://github.com/samuelcolvin/python-devtools) from 0.6.0 to 0.6.1.
- [Release notes](https://github.com/samuelcolvin/python-devtools/releases)
- [Changelog](https://github.com/samuelcolvin/python-devtools/blob/master/HISTORY.md)
- [Commits](https://github.com/samuelcolvin/python-devtools/compare/v0.6...v0.6.1)

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

* remove unnecessary dependencies

* tweaks while testing 3.9

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-10-26 09:53:28 +00:00
Samuel Colvin a25aba26b5 linting as a separate CI step (#2030)
* linting as a separate ci step

* CI and docs improvements

* fix docs preview

* fix docs, benchmarks fastapi tests

* fix formatting and docs build

* tweak publishing docs

* fix for new download-artifact action

* skip check tag to check docs build

* prepare for merge
2020-10-25 15:03:33 +00:00
PrettyWood e2fcab52b9 fix: validate and parse nested models properly with default_factory (#1712)
* fix: validate nested models with `default_factory`

PR #1504 introduced a regression by bypassing `populate_validators()`,
which would skip the validation of children in nested models
with `default_factory`

closes #1710

* test: add example of nested models parsing with `default_factory`

closes #1717

* add testcase from #1722

* bodge for benchmarks

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-07-15 20:23:18 +01:00
Samuel Colvin 43f61d4b76 error on failed import in benchmarks (#1661) 2020-06-27 13:42:59 +01:00
Samuel Colvin 529130f2c2 fix profiling for latest pydantic 2020-04-27 13:25:43 +01:00
Stephen Brown II 0ba7710f35 Add JSON Benchmark (#1344)
* Add JSON Benchmark

* Apply iterator suggestions from code review

Co-Authored-By: Samuel Colvin <samcolvin@gmail.com>

* Reorganize run to avoid parsing time in json test

* tweak json benchmarks

Co-authored-by: Samuel Colvin <samcolvin@gmail.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-04-15 21:52:04 +01:00
Stephen Brown II 0164db9daa Fix typo breaking pydantic-only benchmarks when TestCAttrs not available (#1282)
* Fix typo breaking pydantic-only benchmarks when TestCAttrs not available

* Add Pydantic-only benchmarks to CI


Remove requirements for pydantic-only benchmarks and update python ver

* Benchmarks output tweaks

- Left pad by only 4 more than the longest benchmark
- Add run number/total to each run
- Summarize what is being tested at beginning
2020-03-18 13:05:47 +00:00
Stephen Brown II 938335c46f Add benchmark for voluptuous library (#1292)
Voluptuous, despite the name, is a Python data validation library.

- GitHub: https://github.com/alecthomas/voluptuous
- PyPi: https://pypi.org/project/voluptuous

Package | Version | Relative Performance | Mean validation time
--- | --- | --- | ---
valideer | `0.4.2` |  | 104.2μs
attrs + cattrs | `19.3.0` | 1.1x slower | 114.4μs
pydantic | `1.4a1` | 1.2x slower | 124.3μs
marshmallow | `3.5.0` | 1.8x slower | 190.1μs
voluptuous | `0.11.7` | 2.2x slower | 227.6μs
trafaret | `2.0.2` | 2.4x slower | 253.0μs
django-rest-framework | `3.11.0` | 8.5x slower | 881.8μs
cerberus | `1.3.2` | 19.1x slower | 1993.8μs
2020-03-06 13:31:43 +00:00
François Voron e478278474 Documentation: rename benchmark django-restful-framework -> django-rest-framework (#1119)
* Rename django-rest-framework benchmark

* Add change file for #1119

* Rename django-rest-framework in existing benchmarks results
2019-12-20 11:31:16 +00:00
Samuel Colvin 9255012c08 add version_info to make creating issues easier (#1071)
* add version_info to make creating issues easier

* improve version_info()

* improve contributing docs
2019-12-04 15:14:53 +00:00
Samuel Colvin 677537d1f5 Improve benchmarks (#987)
* add benchmarks for cerberus

* remove toasted-marshmallow, upgrade marshmallow
2019-11-13 15:34:31 +00:00
Samuel Colvin 4218ff7f36 rename cattr > cattrs, update benchmarks 2019-11-08 17:41:12 +00:00
George Sakkis 69737c3aa3 Add benchmark for valideer (#670)
* Add benchmark for valideer

* valideer version and update benchmarks

* add change

* correct benchmarks
2019-11-08 17:34:39 +00:00
Sebastian Mika b87ca4ee05 benchmark for cattrs (#513)
* benchmark for attr

* update HISTORY.rst

* * added benchmark using cattr
* add env "ATTRS=1" to benchmark runner to only compare again the two
  and save results in separate csv
* added section to docs/index

* nits

* re-run benchmark with cython pydantic; merge results back to main benchmarks results table

* pin pydantic to top of benchmark report

* remove attrs, fix cattrs

* update benchmarks output

* add change
2019-11-08 17:04:41 +00:00
Samuel Colvin c3098a30cf Consistent __repr__ and __str__ methods for all types (#884)
* Consistent __repr__ and __str__ methods for all types

* add change description

* devtools integration and feedback on repr methods

* fix Color repr

* tests for truncate

* add devtools section to docs

* tests for devtools

* ValidationError inheriting from Representation

* fix imports

* tweaks

* tweak docs

* exec_examples.py integration with __repr__ changes
2019-10-14 17:37:04 +01:00
Samuel Colvin 33b7d52d31 moving docs to mkdocs (#856)
* moving docs to mkdocs

* transfering readme to md and more

* fixing build

* splitting usage.md

* improving schema.md and index.md

* fix make_history.rst

* models intro

* working on data conversation and required fields

* more fixes to models.md

* list all standard types supported

* list of pydantic types

* tweaks

* update links in code

* Apply suggestions from code review

incorporate @dmontagu's suggestions.

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>

* Apply suggestions from code review

more missed suggestions.

Co-Authored-By: dmontagu <35119617+dmontagu@users.noreply.github.com>

* Apply suggestions from code review

more corrects.

* cleanup

* Field order warning

* fix and regenerate benchmarks

* format examples better, cleanup

* improve schema mapping table

* correct highlighting file types in schema.md

* add redirects in javascript

* add logo
2019-10-07 17:19:01 +01:00
Samuel Colvin 24ac05276b big performance improvement! (#819)
* big performance improvement!

* exception performance improvement

* check errors and explicit export from errors.py

* more tweaks

* fix coverage

* fix tests and remove "from e" in exceptions for performance
2019-09-18 15:00:43 +01:00
Samuel Colvin 0e8cfba713 small performance improvements to validators and fields (#763)
* small performance improvements to validators and fields

* simplify ErrorWrapper and ValidationError

* more cleanup of errors, combine test_error_wrapper.py and test_error.py

* tweak datetime_parse.py

* fix for python 3.6

* add change

* fix bug with int or float passed to datetime.time
2019-08-18 16:48:39 +01:00
Or Carmi 9900c7f00c Refactored extra types to use a single enum (#352)
deprecated `ignore_extra` and `allow_extra` Config fields in favor of `extra`, fix #352

* refaactored extra types to use a single enum

* slightly simplified

* added tests

* fixed most stuff

* docs and some simplifications

* better assert

* changed enum and fixed logic

* trying to capture deprecation warning

* make format

* fixing tests and moving exta logic to __new__

* set_extra tests

* fox benchmarks

* formatting

* updated history

* docs

* added a negative tests

* reverted format changes

* format

* matched casing

* renamed values

* more fixes

* forgot values change

* another one

* weird stuff

* linting issue

* Update pydantic/main.py

Co-Authored-By: liiight <4374581+liiight@users.noreply.github.com>
2019-02-04 13:15:07 +00:00
Samuel Colvin 85f8a6b60e fix benchmarks with 3.7 (#219) 2018-07-02 12:28:46 +01:00
Samuel Colvin 2966beeb40 rerun benchmarks, update history 2018-03-25 18:24:40 +01:00
Samuel Colvin 1077a884ac fix benchmarks 2017-11-06 15:19:16 +00:00
Samuel Colvin 7c9c0d46aa fix toastedmarshmallow benchmarks and add marshmallow benchmarks (#91)
* fix toastedmarshmallow benchmarks and add marshmallow benchmarks

* format benchmarks better

* add runtime for netlify

* remove sphinxcontrib-spelling==4.0.1

* remove docs linting

* adding benchmarks section to docs
2017-10-23 19:53:35 +01:00
Mickaël Guérin 1d9a337f70 Add Toasted Marshmallow Benchmark (#85)
https://github.com/lyft/toasted-marshmallow

As said in the README of this project :
Toasted Marshmallow implements a JIT for marshmallow that speeds up
dumping objects 10-25X (depending on your schema). Toasted Marshmallow
allows you to have the great API that Marshmallow provides without
having to sacrifice performance!
2017-10-23 15:26:51 +01:00
Samuel Colvin 5efa54d80d annotation only fields first 2017-07-08 19:01:38 +01:00
Samuel Colvin ebca8df223 improving benchmarks 2017-07-08 17:31:13 +01:00
Samuel Colvin 71a3b45995 speedup benchmarks 2017-06-13 10:15:19 +01:00
Samuel Colvin 6923e5e677 models allowing immutability (#44)
* working on models allowing immutability, ref #38

* up complexity

* use noqa c901

* fixing fields with new processor

* allow_mutation config and tests

* uprev, history and docs

* fix typos
2017-06-13 09:52:47 +01:00
Mickaël Guérin 8364a6b2d6 Add DRF Benchmark (#47) 2017-06-12 18:57:46 +01:00
Samuel Colvin 7f50946722 adding more usage examples 2017-06-03 17:04:10 +01:00
Samuel Colvin 11ea624e62 add int size validation 2017-05-08 17:25:44 +01:00
Samuel Colvin ca1551f6fc pyup ignore benchmarks 2017-05-08 15:58:08 +01:00
Samuel Colvin ef60baa65e adding performance benchmarks 2017-05-08 15:56:36 +01:00