Due to some problems when running write_pyi, this includes the following
changes:
1. move the sys.path.append up before alembic is imported - this is
using global imports otherwise
2. use tox to run write_pyi in order to avoid globally installed
dependencies
import textwrap
import typing
+sys.path.append(str(Path(__file__).parent.parent))
+
from alembic.autogenerate.api import AutogenContext
from alembic.ddl.impl import DefaultImpl
from alembic.runtime.migration import MigrationInfo
-sys.path.append(str(Path(__file__).parent.parent))
-
if True: # avoid flake/zimports messing with the order
from alembic.operations.base import BatchOperations
from alembic.operations.base import Operations
commands =
flake8 ./alembic/ ./tests/ setup.py docs/build/conf.py {posargs}
black --check setup.py tests alembic
+
+[testenv:write_pyi]
+basepython = python3
+deps=
+ sqlalchemy>=2
+ mako
+ zimports
+ black==24.1.1
+commands = python tools/write_pyi.py