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