Skip to content

Commit

Permalink
Cleanup, fixing CI fails (#1591)
Browse files Browse the repository at this point in the history
* Cleanup, fixing CI fails

* Fix tests

* Fix tests

* Fix tests

* Pin old coverage version

* try other version of coveralls

* Change asserts in faulty test

* Fix test

* Fix test

---------

Co-authored-by: a_bondar <[email protected]>
  • Loading branch information
abondar and a_bondar authored Apr 24, 2024
1 parent 0c8efde commit eb20ebb
Show file tree
Hide file tree
Showing 57 changed files with 427 additions and 314 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ jobs:
TORTOISE_MSSQL_DRIVER: ODBC Driver 18 for SQL Server
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10", "3.11"]
python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"]
steps:
- uses: actions/cache@v3
with:
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ up:
@poetry update

deps:
@poetry install -E asyncpg -E aiomysql -E asyncmy -E accel -E psycopg -E asyncodbc
@poetry install -E asyncpg -E aiomysql -E accel -E psycopg -E asyncodbc

check: deps build
ifneq ($(shell which black),)
Expand Down
1 change: 1 addition & 0 deletions examples/basic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This example demonstrates most basic operations with single model
"""

from tortoise import Tortoise, fields, run_async
from tortoise.models import Model

Expand Down
1 change: 1 addition & 0 deletions examples/basic_comments.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
This example demonstrates most basic operations with single model
and a Table definition generation with comment support
"""

from tortoise import Tortoise, fields, run_async
from tortoise.models import Model

Expand Down
1 change: 1 addition & 0 deletions examples/complex_filtering.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@
Key points are filtering by related names and using Q objects
"""

from tortoise import Tortoise, fields, run_async
from tortoise.expressions import Q
from tortoise.models import Model
Expand Down
1 change: 1 addition & 0 deletions examples/manual_sql.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This example demonstrates executing manual SQL queries
"""

from tortoise import Tortoise, connections, fields, run_async
from tortoise.models import Model
from tortoise.transactions import in_transaction
Expand Down
1 change: 1 addition & 0 deletions examples/postgres.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This example showcases postgres features
"""

from tortoise import Tortoise, fields, run_async
from tortoise.models import Model

Expand Down
2 changes: 1 addition & 1 deletion examples/pydantic/basic.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This example demonstrates pydantic serialisation
"""

from tortoise import Tortoise, fields, run_async
from tortoise.contrib.pydantic import pydantic_model_creator, pydantic_queryset_creator
from tortoise.models import Model
Expand Down Expand Up @@ -60,7 +61,6 @@ class Meta:
async def run():
await Tortoise.init(db_url="sqlite://:memory:", modules={"models": ["__main__"]})
await Tortoise.generate_schemas()

Event_Pydantic = pydantic_model_creator(Event)
Event_Pydantic_List = pydantic_queryset_creator(Event)
Tournament_Pydantic = pydantic_model_creator(Tournament)
Expand Down
1 change: 1 addition & 0 deletions examples/pydantic/early_init.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This example demonstrates pydantic serialisation, and how to use early partial init.
"""

from tortoise import Tortoise, fields
from tortoise.contrib.pydantic import pydantic_model_creator
from tortoise.models import Model
Expand Down
1 change: 1 addition & 0 deletions examples/pydantic/recursive.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This example demonstrates pydantic serialisation of a recursively cycled model.
"""

from tortoise import Tortoise, fields, run_async
from tortoise.contrib.pydantic import pydantic_model_creator
from tortoise.exceptions import NoValuesFetched
Expand Down
1 change: 1 addition & 0 deletions examples/pydantic/tutorial_1.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* Evaluating the generated schema
* Simple serialisation with both .model_dump() and .model_dump_json()
"""

from tortoise import Tortoise, fields, run_async
from tortoise.contrib.pydantic import pydantic_model_creator
from tortoise.models import Model
Expand Down
1 change: 1 addition & 0 deletions examples/pydantic/tutorial_2.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Creating a list-model to serialise a queryset
* Default sorting is honoured
"""

from tortoise import Tortoise, fields, run_async
from tortoise.contrib.pydantic import pydantic_queryset_creator
from tortoise.models import Model
Expand Down
1 change: 1 addition & 0 deletions examples/pydantic/tutorial_3.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Relationships
* Early model init
"""

from tortoise import Tortoise, fields, run_async
from tortoise.contrib.pydantic import pydantic_model_creator
from tortoise.models import Model
Expand Down
1 change: 1 addition & 0 deletions examples/pydantic/tutorial_4.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
* Configuring model creator via PydanticMeta class.
* Using callable functions to annotate extra data.
"""

from tortoise import Tortoise, fields, run_async
from tortoise.contrib.pydantic import pydantic_model_creator
from tortoise.exceptions import NoValuesFetched
Expand Down
1 change: 1 addition & 0 deletions examples/relations.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
to declare relations and use of .prefetch_related() and .fetch_related()
to get this related objects
"""

from tortoise import Tortoise, fields, run_async
from tortoise.exceptions import NoValuesFetched
from tortoise.models import Model
Expand Down
1 change: 1 addition & 0 deletions examples/relations_recursive.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
* To use .fetch_related(…) to emulate sync behaviour
* That insert-order gets preserved for ForeignFields, but not ManyToManyFields
"""

from tortoise import Tortoise, fields, run_async
from tortoise.models import Model

Expand Down
1 change: 1 addition & 0 deletions examples/relations_with_unique.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
Key points in this example are use of ForeignKeyField and OneToOneField has to_field.
For other basic parts, it is the same as relation example.
"""

from tortoise import Tortoise, fields, run_async
from tortoise.models import Model
from tortoise.query_utils import Prefetch
Expand Down
1 change: 1 addition & 0 deletions examples/router.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This example to use router to implement read/write separation
"""

from typing import Type

from tortoise import Tortoise, fields, run_async
Expand Down
1 change: 1 addition & 0 deletions examples/schema_create.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This example demonstrates SQL Schema generation for each DB type supported.
"""

from tortoise import Tortoise, connections, fields, run_async
from tortoise.models import Model
from tortoise.utils import get_schema_sql
Expand Down
1 change: 1 addition & 0 deletions examples/signals.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This example demonstrates model signals usage
"""

from typing import List, Optional, Type

from tortoise import BaseDBAsyncClient, Tortoise, fields, run_async
Expand Down
1 change: 1 addition & 0 deletions examples/transactions.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
This example demonstrates how you can use transactions with tortoise
"""

from tortoise import Tortoise, fields, run_async
from tortoise.exceptions import OperationalError
from tortoise.models import Model
Expand Down
1 change: 1 addition & 0 deletions examples/two_databases.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
Key notes of this example is using db_route for Tortoise init
and explicitly declaring model apps in class Meta
"""

from tortoise import Tortoise, connections, fields, run_async
from tortoise.exceptions import OperationalError
from tortoise.models import Model
Expand Down
Loading

0 comments on commit eb20ebb

Please sign in to comment.