Commit Graph
100 Commits
Author SHA1 Message Date
500625f0ec WIP - Pydantic v2 support (#1238)
* WIP

* WIP - make test_model_definition tests pass

* WIP - make test_model_methods pass

* WIP - make whole test suit at least run - failing 49/443 tests

* WIP fix part of the getting pydantic tests as types of fields are now kept in core schema and not on fieldsinfo

* WIP fix validation in update by creating individual fields validators, failing 36/443

* WIP fix __pydantic_extra__ in intializing model, fix test related to pydantic config checks, failing 32/442

* WIP - fix enum schema in model_json_schema, failing 31/442

* WIP - fix copying through model, fix setting pydantic fields on through, fix default config and inheriting from it, failing 26/442

* WIP fix tests checking pydantic schema, fix excluding parent fields, failing 21/442

* WIP some missed files

* WIP - fix validators inheritance and fix validators in generated pydantic, failing 17/442

* WIP - fix through models setting - only on reverse side of relation, but always on reverse side, failing 15/442

* WIP - fix through models setting - only on reverse side of relation, but always on reverse side, failing 15/442

* WIP - working on proper populating __dict__ for relations for new schema dumping, some work on openapi docs, failing 13/442

* WIP - remove property fields as pydantic has now computed_field on its own, failing 9/442

* WIP - fixes in docs, failing 8/442

* WIP - fix tests for largebinary schema, wrapped bytes fields fail in pydantic, will be fixed in pydantic-core, remaining is circural schema for related models, failing 6/442

* WIP - fix to pk only models in schemas

* Getting test suites to pass (#1249)

* wip, fixing tests

* iteration, fixing some more tests

* iteration, fixing some more tests

* adhere to comments

* adhere to comments

* remove unnecessary dict call, re-add getattribute for testing

* todo for reverse relationship

* adhere to comments, remove prints

* solve circular refs

* all tests pass 🎉

* remove 3.7 from tests

* add lint and type check jobs

* reforat with ruff, fix jobs

* rename jobs

* fix imports

* fix evaluate in py3.8

* partially fix coverage

* fix coverage, add more tests

* fix test ids

* fix test ids

* fix lint, fix docs, make docs fully working scripts, add test docs job

* fix pyproject

* pin py ver in test docs

* change dir in test docs

* fix pydantic warning hack

* rm poetry call in test_docs

* switch to pathlib in test docs

* remove coverage req test docs

* fix type check tests, fix part of types

* fix/skip next part of types

* fix next part of types

* fix next part of types

* fix coverage

* fix coverage

* fix type (bit dirty 🤷)

* fix some code smells

* change pre-commit

* tweak workflows

* remove no root from tests

* switch to full python path by passing sys.executable

* some small refactor in new base model, one sample test, change makefile

* small refactors to reduce complexity of methods

* temp add tests for prs against pydantic_v2

* remove all references to __fields__

* remove all references to construct, deprecate the method and update model_construct to be in line with pydantic

* deprecate dict and add model_dump, todo switch to model_dict in calls

* fix tests

* change to union

* change to union

* change to model_dump and model_dump_json from dict and json deprecated methods, deprecate them in ormar too

* finish switching dict() -> model_dump()

* finish switching json() -> model_dump_json()

* remove fully pydantic_only

* switch to extra for payment card, change missed json calls

* fix coverage - no more warnings internal

* fix coverage - no more warnings internal - part 2

* split model_construct into own and pydantic parts

* split determine pydantic field type

* change to new field validators

* fix benchmarks, add codspeed instead of pytest-benchmark, add action and gh workflow

* restore pytest-benchmark

* remove codspeed

* pin pydantic version, restore codspeed

* change on push to pydantic_v2 to trigger first one

* Use lifespan function instead of event (#1259)

* check return types

* fix imports order, set warnings=False on json that passes the dict, fix unnecessary loop in one of the test

* remove references to model's meta as it's now ormar config, rename related methods too

* filter out pydantic serializer warnings

* remove choices leftovers

* remove leftovers after property_fields, keep only enough to exclude them in initialization

* add migration guide

* fix meta references

* downgrade databases for now

* Change line numbers in documentation (#1265)

* proofread and fix the docs, part 1

* proofread and fix the docs for models

* proofread and fix the docs for fields

* proofread and fix the docs for relations

* proofread and fix rest of the docs, add release notes for 0.20

* create tables in new docs src

* cleanup old deps, uncomment docs publish on tag

* fix import reorder

---------

Co-authored-by: TouwaStar <30479449+TouwaStar@users.noreply.github.com>
Co-authored-by: Goran Mekić <meka@tilda.center>
2024-03-23 19:28:28 +01:00
collerek 3a206dd8dc add version provider 2024-02-12 22:57:23 +01:00
collerek 7f3b15889f Add mike (#1264)
* check return types

* set site url

* change docs publish to tag, for now comment it out
2024-02-12 19:25:44 +01:00
collerek 3643239ac2 add benchmarks to master (#1263) 2024-02-08 10:57:18 +01:00
collerek c793d665fe Update releases (#1111) 2023-06-18 19:04:53 +02:00
collerek b1ab0de4d4 Bump supported fastapi versions (#1110)
* Bump supported fastapi version to <=0.97, change all fastapi tests from starlette client to httpx.AsyncClient

* Add lifecycle manager to fastapi tests

* Fix coverage

* Add python 3.11 to test suite, bump version
2023-06-18 18:52:06 +02:00
collerek 2c363a6432 Update poetry to 1.4.1 (#1036) 2023-04-02 10:54:46 +02:00
collerek 70043f96c2 Fix poetry version conflicts 2023-02-28 13:09:06 +01:00
collerek fd77f029c2 Release 0.12.1 (#998) 2023-01-29 13:20:16 +01:00
collerek dda5e24e94 Prepare 0.12.0 release (#892) 2022-10-21 19:53:00 +02:00
collerek 513fd32cc8 Fix property_fields not being inherited. Fix for #774. (#891)
* Fix property_fields not being inherited. Fix for #774.

* Fix coverage

* Fix coverage by removing set attribute update - during inheriting the current property fields are not set yet.
2022-10-21 16:18:37 +02:00
collerek f1c0ee336b Fix wrongly excluding relations if they were not in proper order and one of them were excluded. Fix for #779 (#890) 2022-10-21 14:38:16 +02:00
collerek 4fa0205598 Allow upserting rows with existing_pk even if they do not exist. (#889)
* Allow for __force_save__ in Model.upsert() method to save the models despite they already have a pk set. On integrity Error proceed to update the model, so in worst case two db calls will be made.

* Fix coverage

* Change implementation to checking if the row exists as postgres leaves hanging invalid transaction on integrity error. On force_save always check if row exists and then save/update (so always two queries).
2022-10-21 13:32:36 +02:00
collerek 05ca809956 bump codecov version 2022-10-18 10:25:16 +02:00
collerek 3661967a27 Bump dependencies (#874)
* fix pytest-asynio bump to 0.19

* bump mypy

* fix coverage of async fixtures
2022-10-11 16:29:41 +02:00
collerek 3cd33e6d8b update release notes (#818) 2022-09-07 12:55:37 +02:00
collerek 970f98005a free mysql and pymysl versions to include 0.1.x (#807) 2022-08-30 14:58:28 +02:00
collerek 2cc967ab2a Merge branch 'master' of https://github.com/collerek/ormar 2022-07-19 10:23:38 +02:00
collerek 637d9a9ecc add dependabot auto approve 2022-07-19 10:23:20 +02:00
collerek 3b171ddfd4 bump typing-extensions version 2022-07-04 16:43:32 +02:00
collerek 6af92aa893 Fix enum schema (#715)
* fix schema with enum fields - issue #699

* fix drivers dependencies - make them optional

* fix command

* provide extras

* add bolean field to related model

* add test with select related and boolean

* new test case based on issue

* fix bool issue in postgres limit queries - issue #704

* fix coverage

* bump version and add release info
2022-06-26 19:36:13 +02:00
collerek 4d76934a9d 0.11.1 - Fix deepcopy issues (#695)
* fix deepcopy issues

* bump version, add release changelog
2022-06-08 19:18:35 +02:00
collerek 1a99a65eb4 Change docs provider (#652)
* switch to mkdocstrings

* update lock
2022-05-06 12:50:26 +02:00
collerek 66e198e48e bump pydoc-markdow docs action 2022-05-04 15:28:13 +02:00
collerek f47085cc5e bump pydoc-markdow docs action 2022-05-04 15:26:05 +02:00
collerek 1d5ed40ea4 bump docs publish versions 2022-05-04 15:06:21 +02:00
collerek 43374f1b1a bump docs publish versions 2022-05-04 14:59:25 +02:00
collerek 5b876498e1 fix mypy 2022-05-04 14:36:51 +02:00
collerek e9275a9b35 add auto merge to dpbot 2022-05-04 10:15:41 +02:00
collerek 90f78e2fa7 Draft 0.11.0 (#594)
* fix for #584

* fix for #580

* fix typing

* connect to db in test

* refactor test

* remove async mark

* connect client

* fix mypy

* fix mypy

* update deps

* check py3.10?

* remove py3.6, bump version
2022-03-28 18:47:35 +02:00
collerek 8376b6635e Merge pull request #557 from MojixCoder/master
Update get_or_create method
2022-03-28 13:04:55 +02:00
collerek 1b4daa2c01 add _default clarification in docs 2022-03-28 12:57:48 +02:00
collerek 4776d1e32f Merge pull request #589 from erichaydel/588-fix-queryset-count-bug
Fix collerek/ormar#588 Bug in queryset count() method
2022-03-28 11:56:43 +02:00
collerek 989e11e066 Merge pull request #576 from collerek/check_null_json
Add plugable queryset_class, enhance IndexColumns and bug fixes
2022-02-25 12:16:47 +01:00
collerek b599cc2e4f fix json dates 2022-02-25 11:53:58 +01:00
collerek d15c4c5c6a change orjson deps 2022-02-25 11:42:50 +01:00
collerek be7a0ff9c1 prepare_next_rel 2022-02-25 11:30:32 +01:00
collerek f26fafe04c fix json nullable column 2022-02-25 10:46:33 +01:00
collerek 5718999643 Merge pull request #575 from zevisert/master
fix: IndexConstraint should pass kw-args to sqlalchemy
2022-02-25 09:35:28 +01:00
collerek 4ed267e5c3 Merge pull request #538 from ponytailer/bugfix-bulk-create
Bugfix: dumps the object which has the json fields in bulk create
2022-01-26 18:07:08 +01:00
collerek 0e167dc89f use existing encode_json to avoid code duplication, rename queryset customization param and move it to Meta, move docs to models from inheritance 2022-01-26 17:59:00 +01:00
collerek 8dc05d5cf4 Merge pull request #526 from collerek/dependabot/pip/flake8-bugbear-22.1.11
Bump flake8-bugbear from 21.11.29 to 22.1.11
2022-01-17 18:49:13 +01:00
collerek 650341bf39 Merge pull request #528 from collerek/dependabot/pip/types-aiofiles-0.8.3
Bump types-aiofiles from 0.7.3 to 0.8.3
2022-01-17 18:40:33 +01:00
collerek 739cf1c8c3 Merge pull request #482 from collerek/dependabot/pip/cryptography-36.0.1
Bump cryptography from 36.0.0 to 36.0.1
2022-01-17 18:31:29 +01:00
collerek 6ec4825b67 Merge pull request #508 from collerek/check_timezones_filters
Fix timezones and add support for pydantic 1.9.0
2022-01-14 23:44:06 +01:00
collerek b208e88eb6 Merge branch 'master' into check_timezones_filters 2022-01-14 23:40:03 +01:00
collerek 433d4501e9 Merge pull request #525 from Mng-dev-ai/add-comments-to-bulk-create
add comments
2022-01-14 18:57:11 +01:00
collerek 5677bda054 fix json fields in bulk operations 2022-01-14 18:27:49 +01:00
collerek 7f517c9bdb Merge branch 'master' of https://github.com/collerek/ormar into check_timezones_filters 2022-01-14 17:54:20 +01:00
collerek df0ac00dee fix coverage 2022-01-14 17:54:13 +01:00
collerek 8825612ce4 Merge pull request #520 from Mng-dev-ai/improve-bulk-create
improve bulk_create
2022-01-14 17:53:32 +01:00
collerek a9ba9373dd Merge branch 'master' into improve-bulk-create 2022-01-14 17:39:15 +01:00
collerek 3260106a38 Merge pull request #524 from ponytailer/master
new signal: post_bulk_update
2022-01-14 17:38:02 +01:00
collerek 53a2636421 revert docs changes, pin databases, fix mypy 2022-01-14 17:36:18 +01:00
collerek 3373bbc754 Update queryset.py 2022-01-14 17:32:07 +01:00
collerek 24761dd6cc Update queryset.py 2022-01-14 17:11:45 +01:00
collerek a587ad463d Update queryset.py 2022-01-14 17:06:22 +01:00
collerek bf3b36194b bump databases, remove skip on sqlite test 2022-01-14 16:54:26 +01:00
collerek 1ffb28d7b0 Merge pull request #493 from ponytailer/master
use the dict to store the receivers in signal
2022-01-13 17:58:47 +01:00
collerek e7174e321c bump version, update release info 2022-01-06 19:57:09 +01:00
collerek 646a901af5 clean unused code 2022-01-06 19:35:13 +01:00
collerek f91dfd3d61 rc for skip of literal binds 2022-01-06 18:24:05 +01:00
collerek c8586e5b8e rc for skip of literal binds 2022-01-06 18:22:07 +01:00
collerek 067b61460d Merge branch 'master' of https://github.com/collerek/ormar into check_timezones_filters 2022-01-06 16:04:01 +01:00
collerek e651400491 remove 3ts 2022-01-06 15:59:11 +01:00
collerek 3f264d974b wip - remove literal binds 2022-01-05 18:19:14 +01:00
collerek aab46de800 remove date dumping to isoformat, add pydantic 1.9 support 2022-01-03 18:23:22 +01:00
collerek 14b30baf40 add III tier sponsors to main page 2021-12-20 16:19:11 +01:00
collerek 27e5484a4c Merge pull request #488 from collerek/fix_large_binary
Add comments to columns and bugfixes
2021-12-16 18:37:41 +01:00
collerek 531542bb21 fix quotes 2021-12-16 18:31:28 +01:00
collerek f245e91740 #455 fix improper quoting of on clause 2021-12-16 18:19:55 +01:00
collerek 1b9a59b49d #453 make first and get respect user ordering if set on main model 2021-12-16 17:24:23 +01:00
collerek bc5c6222b1 #485 add possibility to pass comments to sqlalchemy 2021-12-16 16:41:50 +01:00
collerek 15be5170f3 fix #409 - nullable large binary fields 2021-12-16 14:44:01 +01:00
collerek 4beac06c52 Merge pull request #429 from Kurbezz/fix-populate-default-values
Fix populate_default_values
2021-11-16 08:28:12 +01:00
collerek 5e946f514a Merge pull request #387 from collerek/test_validaors_inheritance
Test validaors inheritance
2021-10-15 10:53:04 +02:00
collerek d7b823f5b6 bump version 2021-10-15 10:43:06 +02:00
collerek 851fe0c14f fix for validators inheritance 2021-10-15 10:39:41 +02:00
collerek 7f0eee2936 Merge pull request #384 from peerchemist/patch-1
Update README.md
2021-10-13 14:55:07 +02:00
collerek 04009bccd9 Merge pull request #385 from collerek/remove_setup
Remove setup
2021-10-13 14:53:17 +02:00
collerek 8978197d5f add name in project section of pyproject 2021-10-13 14:43:47 +02:00
collerek 79097ec552 remove setup.cfg, fixes in makefile 2021-10-13 14:32:31 +02:00
collerek b197d4d3c7 update publish workflow 2021-10-13 14:05:39 +02:00
collerek b66edca74b Merge pull request #372 from collerek/add_construct
Release 0.10.21 - construct and validators in generated pydantic models
2021-10-13 13:58:08 +02:00
collerek 878f5a459f update lock file after all deps update 2021-10-13 13:41:43 +02:00
collerek 10e2d01a91 update docs, bump version, update releases 2021-10-12 18:52:40 +02:00
collerek 9559c0f7f6 inherit choices validators and class validators for fields in generated pydantic models 2021-10-11 16:22:50 +02:00
collerek f6458be157 fix coverage 2021-10-11 12:22:47 +02:00
collerek b99df7720f remove files option from pre commit config 2021-10-10 14:12:19 +02:00
collerek d8f0dc92f0 refactor choices validation from root validator to field validator 2021-10-10 14:11:25 +02:00
collerek d992f3dc3b add tests to pre-commit black 2021-10-09 20:28:30 +02:00
collerek 3a0fba5a60 switch to expand relationship to allow pk values as models 2021-10-09 20:21:22 +02:00
collerek 127df1e9cb fix mypy, add pre-commit 2021-10-09 19:43:21 +02:00
collerek 4896a3a982 add tests for creation from dictionaries and for m2m relations 2021-10-09 17:19:17 +02:00
collerek 6d2712c0f8 resolve merge conflicts 2021-10-09 16:30:35 +02:00
collerek 8dc1ebcb1e Merge pull request #368 from s3rius/feature/poetry
Added poetry integration.
2021-10-09 16:23:34 +02:00
collerek f28e16dc1c add explicit packages and homepage 2021-10-09 16:12:57 +02:00
collerek 82b4e054a2 ignore overloads for now due to p3.6 errors 2021-10-09 15:47:21 +02:00
collerek a8c218cffe update lock file :facepalm 2021-10-09 15:33:35 +02:00
collerek bf09e42c5f add types-dataclasses for python 3.6 2021-10-09 15:28:26 +02:00