Commit Graph

45 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
11c1e5c183 build(deps): bump codecov/codecov-action from 3.1.5 to 3.1.6 (#1257)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.5 to 3.1.6.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.1.5...v3.1.6)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-31 02:38:40 +00:00
b08f33500f build(deps): bump codecov/codecov-action from 3.1.4 to 3.1.5 (#1253)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.4 to 3.1.5.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.1.4...v3.1.5)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-01-26 02:12:45 +00:00
3224fb8d58 build(deps): bump paambaati/codeclimate-action from 4.0.0 to 5.0.0 (#1132)
Bumps [paambaati/codeclimate-action](https://github.com/paambaati/codeclimate-action) from 4.0.0 to 5.0.0.
- [Release notes](https://github.com/paambaati/codeclimate-action/releases)
- [Changelog](https://github.com/paambaati/codeclimate-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/paambaati/codeclimate-action/compare/v4.0.0...v5.0.0)

---
updated-dependencies:
- dependency-name: paambaati/codeclimate-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: collerek <collerek@gmail.com>
2023-08-15 12:40:18 +02:00
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
bddf7e2c9b build(deps): bump paambaati/codeclimate-action from 3.2.0 to 4.0.0 (#1067)
Bumps [paambaati/codeclimate-action](https://github.com/paambaati/codeclimate-action) from 3.2.0 to 4.0.0.
- [Release notes](https://github.com/paambaati/codeclimate-action/releases)
- [Changelog](https://github.com/paambaati/codeclimate-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/paambaati/codeclimate-action/compare/v3.2.0...v4.0.0)

---
updated-dependencies:
- dependency-name: paambaati/codeclimate-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: collerek <collerek@gmail.com>
2023-05-19 11:57:58 +02:00
accd41401b build(deps): bump codecov/codecov-action from 3.1.3 to 3.1.4 (#1084)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.3 to 3.1.4.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.1.3...v3.1.4)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-05-16 11:03:52 +08:00
60713a046a build(deps): bump codecov/codecov-action from 3.1.2 to 3.1.3 (#1065)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.2 to 3.1.3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.1.2...v3.1.3)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-21 11:04:56 +08:00
85b0554c58 build(deps): bump codecov/codecov-action from 3.1.1 to 3.1.2 (#1053)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.1 to 3.1.2.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.1.1...v3.1.2)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-12 10:07:04 +07:00
2c363a6432 Update poetry to 1.4.1 (#1036) 2023-04-02 10:54:46 +02:00
70043f96c2 Fix poetry version conflicts 2023-02-28 13:09:06 +01:00
7c18fa55e7 Add benchmarking test suite and greatly improve performance in a few cases (#948)
* Add benchmarking test suite

* Improve amortized time of model relation loads with a large number of rows

* Improve performance of loading models with many related models

* Improve performance of loading models with many related models to O(N)ish

* Fix bug where N model creation with shared related model would build in N^2 time

* Lower blocking time for queryset results

* Add docstrings and streamline hash code

Co-authored-by: haydeec1 <Eric.Haydel@jhuapl.edu>
2022-12-10 17:12:11 +01:00
8fca2efad7 build(deps): bump paambaati/codeclimate-action from 3.1.1 to 3.2.0 (#898)
Bumps [paambaati/codeclimate-action](https://github.com/paambaati/codeclimate-action) from 3.1.1 to 3.2.0.
- [Release notes](https://github.com/paambaati/codeclimate-action/releases)
- [Changelog](https://github.com/paambaati/codeclimate-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/paambaati/codeclimate-action/compare/v3.1.1...v3.2.0)

---
updated-dependencies:
- dependency-name: paambaati/codeclimate-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-24 02:48:59 +00:00
f94e507d70 build(deps): bump paambaati/codeclimate-action from 3.1.0 to 3.1.1 (#888)
Bumps [paambaati/codeclimate-action](https://github.com/paambaati/codeclimate-action) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/paambaati/codeclimate-action/releases)
- [Changelog](https://github.com/paambaati/codeclimate-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/paambaati/codeclimate-action/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: paambaati/codeclimate-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-21 05:02:54 +02:00
1f57c0bd52 build(deps): bump codecov/codecov-action from 3.1.0 to 3.1.1 (#886)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 3.1.0 to 3.1.1.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/main/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v3.1.0...v3.1.1)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-19 02:50:51 +00:00
05ca809956 bump codecov version 2022-10-18 10:25:16 +02:00
6d75e908bc build(deps): bump paambaati/codeclimate-action from 3.0.0 to 3.1.0 (#883)
Bumps [paambaati/codeclimate-action](https://github.com/paambaati/codeclimate-action) from 3.0.0 to 3.1.0.
- [Release notes](https://github.com/paambaati/codeclimate-action/releases)
- [Changelog](https://github.com/paambaati/codeclimate-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/paambaati/codeclimate-action/compare/v3.0.0...v3.1.0)

---
updated-dependencies:
- dependency-name: paambaati/codeclimate-action
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-17 02:38:24 +00:00
d979151b3a Bump actions/setup-python from 2 to 4.1.0 (#740)
Bumps [actions/setup-python](https://github.com/actions/setup-python) from 2 to 4.1.0.
- [Release notes](https://github.com/actions/setup-python/releases)
- [Commits](https://github.com/actions/setup-python/compare/v2...v4.1.0)

---
updated-dependencies:
- dependency-name: actions/setup-python
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-07-19 09:37:51 +02:00
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
05f3123fec Bump paambaati/codeclimate-action from 2.7.5 to 3.0.0 (#637)
Bumps [paambaati/codeclimate-action](https://github.com/paambaati/codeclimate-action) from 2.7.5 to 3.0.0.
- [Release notes](https://github.com/paambaati/codeclimate-action/releases)
- [Changelog](https://github.com/paambaati/codeclimate-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/paambaati/codeclimate-action/compare/v2.7.5...v3.0.0)

---
updated-dependencies:
- dependency-name: paambaati/codeclimate-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-06 12:58:09 +02:00
fe9eae41cc Bump actions/checkout from 2 to 3 (#640)
Bumps [actions/checkout](https://github.com/actions/checkout) from 2 to 3.
- [Release notes](https://github.com/actions/checkout/releases)
- [Changelog](https://github.com/actions/checkout/blob/main/CHANGELOG.md)
- [Commits](https://github.com/actions/checkout/compare/v2...v3)

---
updated-dependencies:
- dependency-name: actions/checkout
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-04 11:59:34 +02:00
4dd2585733 Bump codecov/codecov-action from 1 to 3 (#639)
Bumps [codecov/codecov-action](https://github.com/codecov/codecov-action) from 1 to 3.
- [Release notes](https://github.com/codecov/codecov-action/releases)
- [Changelog](https://github.com/codecov/codecov-action/blob/master/CHANGELOG.md)
- [Commits](https://github.com/codecov/codecov-action/compare/v1...v3)

---
updated-dependencies:
- dependency-name: codecov/codecov-action
  dependency-type: direct:production
  update-type: version-update:semver-major
...

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

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-05-04 11:59:18 +02:00
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
372dbd1304 Removed trailing whitespace.
Signed-off-by: Pavel <win10@list.ru>
2021-10-09 14:49:40 +04:00
bb2e0d1ddf remove reference to mypy.ini in github workflow, fix some code smells 2021-10-08 20:30:27 +02:00
b2541bed1e Added poetry integration.
Description:
* Fixed github actions;
* Removed requirements.txt;
* Fixed CONTRIBUTING.md;
* Fixed black and flake8.

Signed-off-by: Pavel <win10@list.ru>
2021-10-08 16:56:59 +04:00
04555957b5 pin pip version to run github workflows 2021-08-06 10:52:04 +02:00
f197df0ecd add missing types stubs for deps 2021-06-09 12:23:22 +02:00
956116c59a add missing types stubs for deps 2021-06-09 12:19:26 +02:00
9c2f822e1e add missing types stubs for deps 2021-06-09 12:13:54 +02:00
638af9ad4c fix #173 and https://github.com/uriyyo/fastapi-pagination/issues/73 2021-04-23 15:45:35 +02:00
38a094baf7 modify workflow 2021-04-04 17:39:09 +02:00
e8329c0dcd check orders 2021-03-07 14:10:35 +01:00
04bbe13c09 test cascade 2021-02-01 11:30:59 +01:00
84d67f4745 update workflow for code climate coverage 2021-01-29 15:33:36 +01:00
842e303bc1 add test for python 3.9 and update setup.py file for 3.9. 2021-01-29 14:29:27 +01:00
3438928608 change tests to run on all branches except docs 2020-11-25 21:18:27 +01:00
29c364675f switch badge to github action - rename the action workflow 2020-11-20 13:32:47 +01:00
d61c7b4b1a remove travis, switch to github actions 2020-11-20 13:02:59 +01:00
9cf19fe228 remove travis, switch to github actions 2020-11-20 12:55:56 +01:00
39e7deb249 remove travis, switch to github actions 2020-11-20 12:35:36 +01:00
36a5ef8ad4 remove travis, switch to github actions 2020-11-20 11:49:15 +01:00
69137da2d5 remove travis, switch to github actions 2020-11-20 11:47:58 +01:00
86e638ab18 remove travis, switch to github actions 2020-11-20 11:40:43 +01:00
82cdadfe1a Create test-package.yml 2020-11-20 11:37:15 +01:00