chore(deps): limit tortoise-orm version to >=0.21 instead of wildcard (*) (#388)

* Limit tortoise-orm version to `>=0.21` instead of wildcard (*)

* ci: fix typos

* docs: update changelog

* refactor: import MEMORY_SQLITE from tortoise

* Update changelog
This commit is contained in:
Waket Zheng 2024-12-21 11:04:02 +08:00 committed by GitHub
parent 69ce0cafa1
commit 1acb9ed1e7
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
5 changed files with 21 additions and 5 deletions

View File

@ -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

View File

@ -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

View File

@ -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 = {

2
poetry.lock generated
View File

@ -1189,4 +1189,4 @@ toml = ["tomli-w", "tomlkit"]
[metadata]
lock-version = "2.0"
python-versions = "^3.8"
content-hash = "6debce184c7fb1fa5cfb79083a35bf2fe6b2f87dea29f3e8e8e23189bed744b5"
content-hash = "5a17cf1dd79829b76fc2c71cbd83032d70ada4f129cf56973c417eac91a975f6"

View File

@ -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"