diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0e32438..cf4ec3f 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -20,7 +20,11 @@ jobs: options: --health-cmd=pg_isready --health-interval 10s --health-timeout 5s --health-retries 5 strategy: matrix: - python-version: ["3.8", "3.9", "3.10", "3.11", "3.12"] + python-version: ["3.8", "3.9", "3.10", "3.11", "3.12", "3.13"] + tortoise-orm: + - tortoise021 + - tortoise022 + - tortoisedev steps: - name: Start MySQL run: sudo systemctl start mysql.service @@ -38,6 +42,17 @@ jobs: run: | pip install -U pip poetry poetry config virtualenvs.create false + - name: Install dependencies and check style + run: make check + - name: Install TortoiseORM v0.21 + if: matrix.tortoise-orm == 'tortoise021' + run: poetry run pip install --upgrade "tortoise-orm>=0.21,<0.22" + - name: Install TortoiseORM v0.22 + if: matrix.tortoise-orm == 'tortoise022' + run: poetry run pip install --upgrade "tortoise-orm>=0.22,<0.23" + - name: Install TortoiseORM develop branch + if: matrix.tortoise-orm == 'tortoisedev' + run: poetry run pip install --upgrade "git+https://github.com/tortoise/tortoise-orm" - name: CI env: MYSQL_PASS: root @@ -46,4 +61,4 @@ jobs: POSTGRES_PASS: 123456 POSTGRES_HOST: 127.0.0.1 POSTGRES_PORT: 5432 - run: make ci + run: make _testall diff --git a/CHANGELOG.md b/CHANGELOG.md index 5029231..2e985ce 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -19,6 +19,7 @@ #### Changed - Allow run `aerich init-db` with empty migration directories instead of abort with warnings. (#286) +- Add version constraint(>=0.21) for tortoise-orm. (#388) - Move `tomlkit` to optional and support `pip install aerich[toml]`. (#392) ### [0.8.0](../../releases/tag/v0.8.0) - 2024-12-04 diff --git a/conftest.py b/conftest.py index 8518f79..f87aa26 100644 --- a/conftest.py +++ b/conftest.py @@ -8,6 +8,7 @@ from tortoise import Tortoise, expand_db_url, generate_schema_for_client from tortoise.backends.asyncpg.schema_generator import AsyncpgSchemaGenerator from tortoise.backends.mysql.schema_generator import MySQLSchemaGenerator from tortoise.backends.sqlite.schema_generator import SqliteSchemaGenerator +from tortoise.contrib.test import MEMORY_SQLITE from tortoise.exceptions import DBConnectionError, OperationalError from aerich.ddl.mysql import MysqlDDL @@ -15,7 +16,6 @@ from aerich.ddl.postgres import PostgresDDL from aerich.ddl.sqlite import SqliteDDL from aerich.migrate import Migrate -MEMORY_SQLITE = "sqlite://:memory:" db_url = os.getenv("TEST_DB", MEMORY_SQLITE) db_url_second = os.getenv("TEST_DB_SECOND", MEMORY_SQLITE) tortoise_orm = { diff --git a/poetry.lock b/poetry.lock index cff25a0..8acfeef 100644 --- a/poetry.lock +++ b/poetry.lock @@ -1189,4 +1189,4 @@ toml = ["tomli-w", "tomlkit"] [metadata] lock-version = "2.0" python-versions = "^3.8" -content-hash = "6debce184c7fb1fa5cfb79083a35bf2fe6b2f87dea29f3e8e8e23189bed744b5" +content-hash = "5a17cf1dd79829b76fc2c71cbd83032d70ada4f129cf56973c417eac91a975f6" diff --git a/pyproject.toml b/pyproject.toml index 9c1d154..2185b48 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -16,7 +16,7 @@ include = ["CHANGELOG.md", "LICENSE", "README.md"] [tool.poetry.dependencies] python = "^3.8" -tortoise-orm = "*" +tortoise-orm = ">=0.21" asyncpg = { version = "*", optional = true } asyncmy = { version = "^0.2.9", optional = true, allow-prereleases = true } pydantic = "^2.0,!=2.7.0"