tortoise / aerich

A database migrations tool for TortoiseORM, ready to production.
https://github.com/tortoise/aerich
Apache License 2.0
820 stars 94 forks source link

Support pyproject.toml #197

Open ehdgua01 opened 2 years ago

ehdgua01 commented 2 years ago

Do you have a plan to support pyproject.toml for config? Would I request PR If you don't have a plan?

long2ice commented 2 years ago

That's good, see https://github.com/tortoise/aerich/commit/24c1f4cb7d8c12f4dcccb104cca0694b54e928db

ehdgua01 commented 2 years ago

@long2ice Hi, First of all, thank you for your development. However, I think that should keep aerich.ini because that is useful when reducing config file(pyproject.toml) size and keep the backward compatibility.

I think this code can help you (https://github.com/PyCQA/isort/blob/995e016b9d888fea02bedeb5be8ea7f01b694b58/isort/settings.py#L736-L765)

Fyi, I suggest this library because that is faster than tomlkit(ref. https://github.com/hukkin/tomli#performance)

onerandomusername commented 2 years ago

Second the suggestion for tomli over tomlkit.

Tomli is made for speed, tomlkit is a style preserving library. In my own experience, tomlkit takes around 12 seconds to parse a poetry.lock file, while tomli can parse poetry.lock in under a third of a second.

I've also never seen a library require tomlkit, either. Its always tomli or toml. However, toml is unmaintained, so the defacto standard has become tomli.