glib incompatible with Python 3.12 due to distutils usage
This line
https://gitlab.gnome.org/GNOME/glib/-/blame/main/gio/gdbus-2.0/codegen/utils.py#L22
import distutils.version
breaks compatibility with Python 3.12. See https://peps.python.org/pep-0632/#migration-advice
Notice that distutils is sometimes shipped with setuptools, but please don't believe popular belief that installing setuptools is sufficient to make import distutils
work. setuptools has some ugly hacks that magically make import distutils
work, provided that setuptools is installed as a system site-package. That's not an assumption you can make. So best to drop the dependency on distutils altogether.