]> git.ipfire.org Git - thirdparty/sqlalchemy/alembic.git/commit
get write_pyi to support lowercase types with pipes
authorMike Bayer <mike_mp@zzzcomputing.com>
Tue, 16 Dec 2025 14:53:13 +0000 (09:53 -0500)
committerMike Bayer <mike_mp@zzzcomputing.com>
Tue, 16 Dec 2025 15:54:11 +0000 (10:54 -0500)
commit4fff3d29db492a9026cde0d4e3146f572d4280fc
tree27f8e1070f90473e3c63c181b2a3369af9593fa9
parentfeada2888143efad43c1581811f33dc8a2944a58
get write_pyi to support lowercase types with pipes

The specific form of `tuple[] | None` produces a `types.UnionType`
in some way that seems to not be what it has ever been previously
(an explicit Union will give you `<class 'typing._UnionGenericAlias'>`,
apparently).  so repr() this specific case so we can move to newer
typing formats.

As a test, this moves the type of partial_reordering to the newer
format.

Also, write output file using shutil.move from tempfile, so that
crashes of write_pyi dont corrupt the file.

Add version checks for black, python version

bump minimum python version to 3.12 as 3.11 seems to have problems
we dont need to fix

Change-Id: I91914c1e1b979ad84ca8b82d362ed94312645994
alembic/op.pyi
alembic/operations/base.py
alembic/script/write_hooks.py
tests/requirements.py
tools/write_pyi.py