Commit Graph

46 Commits

Author SHA1 Message Date
Eric Jolibois f0fc0828f5 chore: unpin pip and fix CI (#2337)
* chore: unpin pip

revert https://github.com/samuelcolvin/pydantic/commit/de0657e4a5495de9378db9fe15a17334c2b0fae5

* fix CI temporarily

* improve caught warning in pytest

Co-authored-by: Thomas Grainger <tagrain@gmail.com>

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2021-02-11 00:16:14 +01:00
Samuel Colvin de0657e4a5 tempoarily pin pip 2020-12-01 10:26:49 +00:00
Eric Jolibois 2a82bd7ee3 chore: fix contributing steps (#2144)
Following #2030, the requirements to build the documentation are not installed
with the rest making `make docs` crash when following the contributing steps.
As `make install` is only used for this purpose (easy onboarding), let's just add
again the installation of the doc requirements with it
2020-11-30 18:02:36 +00:00
Samuel Colvin 73ed6ed5cb underscore_attrs_are_private causing TypeError (#2053)
* underscore_attrs_are_private causing TypeError, fix #2047

* remove repeat and order alphabetically
2020-10-28 10:19:21 +00:00
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
Arseny Boykov 2f7e40476f include assert in validator test in pytest (#2033)
* include assert in valudator test in pytest

* remove try_assert execution in Makefile

* use pytest.raises

* add newline

* tweak

* undo my mistake

Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-10-25 19:50:38 +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
dependabot[bot] e985857e5a Bump isort from 4.3.21 to 5.1.1 (#1730)
* Bump isort from 4.3.21 to 5.1.1

Bumps [isort](https://github.com/timothycrosley/isort) from 4.3.21 to 5.1.1.
- [Release notes](https://github.com/timothycrosley/isort/releases)
- [Changelog](https://github.com/timothycrosley/isort/blob/develop/CHANGELOG.md)
- [Commits](https://github.com/timothycrosley/isort/compare/4.3.21...5.1.1)

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

* isort 5 compatibility

* fix known_standard_library and apply isort changes

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Samuel Colvin <s@muelcolvin.com>
2020-07-16 10:28:44 +01:00
Samuel Colvin 5dbb1272f6 use codecov github action to do retries (#1709) 2020-07-11 13:00:53 +01:00
Stephen Brown II ec1dca9126 Add linting for docs/examples (#1530) 2020-05-31 14:54:12 +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
Samuel Colvin 32f1d1a8c7 fix build badge 2020-04-14 11:59:03 +01:00
Samuel Colvin 96c9c400bc Move to GitHub actions (#1326)
* trying move to github actions

* move name

* remove travis and cleanup

* macos and windows coverage

* env_vars string

* bump

* bump

* delete old coverage file

* remove coverage.xml

* add 'make test-codecov'

* fix 'make test-codecov'

* beginning build phase

* combined deploy

* try to fix articacts

* remove set.cfg wheel tag

* install cython before build

* fix windows builds

* fix windows builds

* reenable tests

* build docs, test pypi upload

* finalize

* add change description, fix job conditionals
2020-03-21 17:02:07 +00:00
Samuel Colvin 8397cde602 new docs preview (#1206)
* new docs preview

* fix docs build for python 3.8

* fix print statements in index_main.py

* bump

* fix github actions builds

* bump

* uprev

* tweaks
2020-02-03 14:07:01 +00:00
Samuel Colvin 31cac4783b improve pydantic import time (#1132)
* improve pydantic import time, fix #1127, fix #1039

* more tweaks

* tweak utils.py

* defering inspect
2020-01-02 14:35:03 +00:00
Selim Belhaouane bdc3973d90 Allow schema_extra to be a callable (#1054)
* fixes for Windows development

* Allow Config.schema_extra to be a callable
2019-12-09 11:01:17 +00:00
Sebastián Ramírez ea709cc66f Add FastAPI tests to Pydantic's CI tests (#1075)
fix #1041

* Add test-fastapi.sh script, after failing to create reusable variables in Make

* Add test-fastapi Make target

* Add fastapi dir for tests to gitignore

* Add fastapi tests to Travis

* Update test-fastapi to run the minimum (pytest)

* Move make test-fastapi to normal run, no "Without Deps"

* Install Pydantic without Cython for FastAPI tests

* Put FastAPI tests in its own Travis job

* Add PR changes description

* Remove coverage for FastAPI, it's not relevant for Pydantic

* Implement code review changes, refactor Makefile use and fastapi tests

* Add a bug intentionally, to test that FastAPI tests are using the current source

and make sure it actually breaks CI.

* Fix intentional bug. Confirmed it breaks Travis for FastAPI.
2019-12-05 11:35:56 +00:00
Samuel Colvin ae34a6a733 rename allow_population_by_alias -> allow_population_by_field_name (#875)
* rename allow_population_by_alias -> allow_population_by_field_name, fix #585

* add change

* tweak PR template ☣️

* tweak Makefile
2019-10-07 18:40:01 +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 79017111aa new URL parsing (#755)
* new URL parsing, fix #603, fix #541

* AnyUrl parts and more tests

* more coverage and db DSNs

* remove DSN methods

* tests for urlstr

* remove debug

* make AnyStr a subtype of str

* fix with cython

* rearranging networking code

* allowing international domains, cleanup

* support international domains

* better URL builder

* allow underscores in subdomains and domains

* tests for json and schema, max length

* urlstr > stricturl

* updating docs

* tweak docs examples

* tweak docs
2019-09-02 11:37:33 +01:00
dmontagu 27bb336545 Fix broken examples (#753)
* Fix broken examples

* Update changes
2019-08-17 13:03:53 +01:00
dmontagu 6c0f4f31d1 Test mypy integration with pytest (#735)
* Test mypy integration with pytest

* Fix for without deps

* Fix filenames issue

* Remove python run in external-mypy

* Update changes

* Remove external-mypy
2019-08-17 12:59:11 +01:00
Abdussamet Koçak f41d5dca3c Support assert statements inside validators (#653)
* Support assert statements inside validators

* Add a validator example that uses assert

* Add warning about consequences of using -O optimization flag

* Fix a typo

* Fix incomplete validator

* Extend exception name generation

* Improve tests

* Clarify pytest behaviour

* handle assertion error name, fix build

* Address feedback

* docs cleanup

* Incorporate feedback

* fix quotes
2019-08-15 12:06:21 +01:00
dmontagu b84df079a7 Add generic functionality (#595), fix #556
* Added generic functionality

* Skip tests in python 3.6

* double quote -> single quote

* Simplified, with more comprehensive tests

* double quote -> single quote

* Remove unintentional file

* Add caching

* don't cythonize generics.py

* Make work with mypy

* Remove __parameters__

* double quote -> single quote i'll remember one day

* More cleanup and validation

* Removed unwanted file

* A little more cleanup, and finish the PR

* Add proper inheritance

* Added note about inheritance to docs

* Added error for double-parameterizing

* Should build for python3.7

* Works with both 3.6 and 3.7

* Fixed bug with caching for single argument

* handle __name__ for generic models

* double quote -> single quote

* Updated error messages
2019-06-19 11:22:06 +01:00
Samuel Colvin d69ca21ce4 add 'none-any.whl' to pypi upload (#564)
* add 'none-any.whl' to pypi upload

* reset 'if'
2019-05-30 16:15:55 +01:00
Samuel Colvin d473f4abc9 cython (#548)
* user cython for fields.py, parse.py and validators.py, fix #547

* fix coverage

* no cython on windows

* speedup error_wrappers, more cython

* conditional validators

* more tweaks to validators.py

* add compiled check

* fix mypy and tweak

* benchmark with cython

* simplify anystr_strip_whitespace

* build binaries on travis

* fix travis manylinux builds

* correct test stages

* cibuildwheel to dist

* fix manylinux build

* don't upgrade pip on wheel build

* try a fix for cibuildwheel

* speedup deploy stage

* revert file rearrangement, cythonize main.py

* tweak main.py

* update docs and history

* fix deploy stage of travis

* Cythonize more files (#553)

* Cythonize more files

* Tests pass

* Fixed ordering

* Some code cleanup

* Every last file cythonized

* cython coverage

* upgrade cython and tweak build setup

* different build stages
2019-05-30 12:04:15 +01:00
Samuel Colvin ddbf2be9c9 uprev and improve makefile (#459) 2019-04-04 12:55:28 +01:00
Vitaly R. Samigullin 293f348755 Fix black deprecation warnings after pyup update (#451) 2019-04-04 10:02:17 +01:00
Samuel Colvin 9ef401839b add type hints (#373)
* add type hints, fix #372

* fix tests and BaseModel inference

* fix #280

* fix dataclasses and docs

* more typing

* adding hints to fields.py

* type **EVERTHING*

* fix for 3.6

* small speed ups and some typ checks

* correct model.copy

* update history
2019-02-04 21:54:20 +00:00
Samuel Colvin 3c3c0262c0 add contributing docs, (#354)
* add contributing docs, fix #353

* tweaks

* tweaks
2019-01-11 21:08:14 +00:00
Samuel Colvin 15850a43c5 moving to black (#287)
* moving to black

* put back flake8

* remove isort option

* putting back isort

* uprev pycodestyle

* remove black from docs/examples

* tweak parse.py
2018-11-15 11:30:07 +00:00
Samuel Colvin 0839646788 uprev 2018-08-25 17:15:22 +01:00
Samuel Colvin 76db984cc1 prepare for new version update history 2018-03-25 15:54:18 +01:00
Samuel Colvin a8216e37f6 correct history 2017-11-26 17:34:52 +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
Samuel Colvin c81ec9aeec add support for annotation only fields (#41)
* add support for annotation only fields, fix #34

* adding tests with mypy

* adding docs for mypy usage

* adding mypy failure test

* adding alias tests

* tweak mypy tests
2017-06-07 19:56:46 +01:00
Samuel Colvin affea7a45d cleaning up beginning of docs 2017-06-04 14:47:10 +01:00
Samuel Colvin 2528ca7dd4 docs linting and improving first example 2017-06-04 14:00:47 +01:00
Samuel Colvin 12820bad15 correct docs deploy 2017-06-03 22:26:09 +01:00
Samuel Colvin 45cba8b1ae fixing isort, adding deploy recipe 2017-06-03 16:18:02 +01:00
Samuel Colvin 3c37ca1672 starting work on docs 2017-06-03 15:56:37 +01:00
Samuel Colvin ef60baa65e adding performance benchmarks 2017-05-08 15:56:36 +01:00
Samuel Colvin f7acee8646 support typed dicts 2017-05-06 15:07:37 +01:00
Samuel Colvin 003c0a747b adding basic tests 2017-05-05 13:34:59 +01:00
Samuel Colvin a8e844dad5 initial commit 2017-05-03 22:23:41 +01:00