Unable to install 3.48.0 on Fedora 39 with Python 3.12
The recent release 3.48.0 is failing to build and install on Fedora 39. I see that gobject-introspection#488 (closed) mentions this error and that installing python3-setuptools
should resolve this; however, I was only able to resolve this by adding setuptools
to build-system.requires
in pyproject.toml
. Any other workarounds would be appreciated.
This can be reproduced with:
docker run --rm fedora:39 bash -c 'yum -y install cairo-gobject-devel gobject-introspection-devel python3-devel python3-pip python3-setuptools && python3 -m pip install PyGObject==3.48.0'
Error:
Collecting PyGObject==3.48.0
Downloading pygobject-3.48.0.tar.gz (714 kB)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━ 714.2/714.2 kB 5.0 MB/s eta 0:00:00
Installing build dependencies ... done
Getting requirements to build wheel ... done
Installing backend dependencies ... done
Preparing metadata (pyproject.toml) ... error
error: subprocess-exited-with-error
× Preparing metadata (pyproject.toml) did not run successfully.
│ exit code: 1
╰─> [157 lines of output]
+ meson setup /tmp/pip-install-din5wkr1/pygobject_4ee06742c5f541b7b3c892f5c4ab138f /tmp/pip-install-din5wkr1/pygobject_4ee06742c5f541b7b3c892f5c4ab138f/.mesonpy-c0jm3tng -Dbuildtype=release -Db_ndebug=if-release -Db_vscrt=md -Dwheel=true --wrap-mode=nofallback --native-file=/tmp/pip-install-din5wkr1/pygobject_4ee06742c5f541b7b3c892f5c4ab138f/.mesonpy-c0jm3tng/meson-python-native-file.ini
The Meson build system
Version: 1.3.2
Source dir: /tmp/pip-install-din5wkr1/pygobject_4ee06742c5f541b7b3c892f5c4ab138f
Build dir: /tmp/pip-install-din5wkr1/pygobject_4ee06742c5f541b7b3c892f5c4ab138f/.mesonpy-c0jm3tng
Build type: native build
Project name: pygobject
Project version: 3.48.0
C compiler for the host machine: cc (gcc 13.2.1 "cc (GCC) 13.2.1 20231205 (Red Hat 13.2.1-6)")
C linker for the host machine: cc ld.bfd 2.40-14
Host machine cpu family: x86_64
Host machine cpu: x86_64
Program python3 found: YES (/usr/bin/python3)
Found pkg-config: YES (/usr/bin/pkg-config) 1.9.5
Run-time dependency python found: YES 3.12
Run-time dependency gobject-introspection-1.0 found: YES 1.78.1
Run-time dependency glib-2.0 found: YES 2.78.3
Run-time dependency gobject-2.0 found: YES 2.78.3
Run-time dependency gio-2.0 found: YES 2.78.3
Run-time dependency gmodule-2.0 found: YES 2.78.3
Run-time dependency libffi found: YES 3.4.4
Run-time dependency cairo found: YES 1.18.0
Run-time dependency cairo-gobject found: YES 1.18.0
Message: Found pycairo with target Python: /tmp/pip-build-env-hl7o33vh/overlay/lib64/python3.12/site-packages/cairo/include
Compiler for C supports arguments -Wall: YES
Compiler for C supports arguments -Warray-bounds: YES
Compiler for C supports arguments -Wcast-align: YES
Compiler for C supports arguments -Wduplicated-branches: YES
Compiler for C supports arguments -Wextra: YES
Compiler for C supports arguments -Wformat=2: YES
Compiler for C supports arguments -Wformat-nonliteral: YES
Compiler for C supports arguments -Wformat-security: YES
Compiler for C supports arguments -Wimplicit-function-declaration: YES
Compiler for C supports arguments -Winit-self: YES
Compiler for C supports arguments -Wjump-misses-init: YES
Compiler for C supports arguments -Wlogical-op: YES
Compiler for C supports arguments -Wmissing-declarations: YES
Compiler for C supports arguments -Wmissing-format-attribute: YES
Compiler for C supports arguments -Wmissing-include-dirs: YES
Compiler for C supports arguments -Wmissing-noreturn: YES
Compiler for C supports arguments -Wmissing-prototypes: YES
Compiler for C supports arguments -Wnested-externs: YES
Compiler for C supports arguments -Wnull-dereference: YES
Compiler for C supports arguments -Wold-style-definition: YES
Compiler for C supports arguments -Wpacked: YES
Compiler for C supports arguments -Wpointer-arith: YES
Compiler for C supports arguments -Wrestrict: YES
Compiler for C supports arguments -Wreturn-type: YES
Compiler for C supports arguments -Wshadow: YES
Compiler for C supports arguments -Wsign-compare: YES
Compiler for C supports arguments -Wstrict-aliasing: YES
Compiler for C supports arguments -Wstrict-prototypes: YES
Compiler for C supports arguments -Wswitch-default: YES
Compiler for C supports arguments -Wundef: YES
Compiler for C supports arguments -Wunused-but-set-variable: YES
Compiler for C supports arguments -Wwrite-strings: YES
Compiler for C supports arguments -Wno-incompatible-pointer-types-discards-qualifiers: NO
Compiler for C supports arguments -Wno-missing-field-initializers: YES
Compiler for C supports arguments -Wno-unused-parameter: YES
Compiler for C supports arguments -Wno-discarded-qualifiers: YES
Compiler for C supports arguments -Wno-sign-conversion: YES
Compiler for C supports arguments -Wno-cast-function-type: YES
Compiler for C supports arguments -Wno-int-conversion: YES
Compiler for C supports arguments -fno-strict-aliasing: YES
Compiler for C supports arguments -fvisibility=hidden: YES
Configuring config.h using configuration
Compiler for C supports arguments -fvisibility=hidden: YES (cached)
Dependency gobject-introspection-1.0 found: YES 1.78.1 (cached)
Dependency gobject-introspection-1.0 found: YES 1.78.1 (cached)
Program /usr/bin/g-ir-scanner found: YES (/usr/bin/g-ir-scanner)
Dependency gobject-introspection-1.0 found: YES 1.78.1 (cached)
Program /usr/bin/g-ir-compiler found: YES (/usr/bin/g-ir-compiler)
Dependency gio-2.0 found: YES 2.78.3 (cached)
Program /usr/bin/glib-compile-schemas found: YES (/usr/bin/glib-compile-schemas)
Build targets in project: 10
pygobject 3.48.0
User defined options
Native files: /tmp/pip-install-din5wkr1/pygobject_4ee06742c5f541b7b3c892f5c4ab138f/.mesonpy-c0jm3tng/meson-python-native-file.ini
buildtype : release
wrap_mode : nofallback
b_ndebug : if-release
b_vscrt : md
wheel : true
Found ninja-1.11.1.git.kitware.jobserver-1 at /tmp/pip-build-env-hl7o33vh/normal/bin/ninja
+ /tmp/pip-build-env-hl7o33vh/normal/bin/ninja
[1/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygpointer.c.o
[2/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-foreign.c.o
[3/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pyginterface.c.o
[4/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygboxed.c.o
[5/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygoptioncontext.c.o
[6/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygspawn.c.o
[7/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-source.c.o
[8/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-resulttuple.c.o
[9/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygoptiongroup.c.o
[10/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-repository.c.o
[11/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-struct.c.o
[12/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygparamspec.c.o
[13/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygenum.c.o
[14/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-ccallback.c.o
[15/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygflags.c.o
[16/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-property.c.o
[17/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-signal-closure.c.o
[18/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-util.c.o
[19/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-boxed.c.o
[20/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-argument.c.o
[21/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-closure.c.o
[22/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/gimodule.c.o
[23/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-marshal-cleanup.c.o
[24/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-cache.c.o
[25/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-invoke.c.o
[26/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-type.c.o
[27/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-list.c.o
[28/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-fundamental.c.o
[29/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-enum-marshal.c.o
[30/58] Compiling C object tests/libgimarshallingtests.so.p/gimarshallingtestsextra.c.o
[31/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygobject-object.c.o
[32/58] Compiling gschemas tests/gsettings-compile-tests
[33/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-hashtable.c.o
[34/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-error.c.o
[35/58] Compiling C object tests/libregress.so.p/_usr_share_gobject-introspection-1.0_tests_annotation.c.o
[36/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-object.c.o
[37/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-value.c.o
[38/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-array.c.o
[39/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-basictype.c.o
[40/58] Compiling C object tests/testhelper.cpython-312-x86_64-linux-gnu.so.p/test-floating.c.o
[41/58] Compiling C object tests/testhelper.cpython-312-x86_64-linux-gnu.so.p/test-thread.c.o
[42/58] Compiling C object tests/testhelper.cpython-312-x86_64-linux-gnu.so.p/test-unknown.c.o
[43/58] Compiling C object gi/_gi_cairo.cpython-312-x86_64-linux-gnu.so.p/pygi-foreign-cairo.c.o
[44/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-struct-marshal.c.o
[45/58] Compiling C object gi/_gi.cpython-312-x86_64-linux-gnu.so.p/pygi-info.c.o
[46/58] Linking target gi/_gi_cairo.cpython-312-x86_64-linux-gnu.so
[47/58] Compiling C object tests/libregress.so.p/regressextra.c.o
[48/58] Linking target gi/_gi.cpython-312-x86_64-linux-gnu.so
[49/58] Compiling C object tests/testhelper.cpython-312-x86_64-linux-gnu.so.p/testhelpermodule.c.o
[50/58] Linking target tests/testhelper.cpython-312-x86_64-linux-gnu.so
[51/58] Compiling C object tests/libregress.so.p/_usr_share_gobject-introspection-1.0_tests_regress.c.o
[52/58] Linking target tests/libregress.so
[53/58] Generating tests/Regress-1.0.gir with a custom command (wrapped by meson to set env)
FAILED: tests/Regress-1.0.gir
env PKG_CONFIG_PATH=/tmp/pip-install-din5wkr1/pygobject_4ee06742c5f541b7b3c892f5c4ab138f/.mesonpy-c0jm3tng/meson-uninstalled PKG_CONFIG=/usr/bin/pkg-config CC=cc /usr/bin/g-ir-scanner --quiet --no-libtool --namespace=Regress --nsversion=1.0 --warn-all --output tests/Regress-1.0.gir --quiet -I/tmp/pip-install-din5wkr1/pygobject_4ee06742c5f541b7b3c892f5c4ab138f/tests -I/tmp/pip-install-din5wkr1/pygobject_4ee06742c5f541b7b3c892f5c4ab138f/.mesonpy-c0jm3tng/tests -I/usr/share/gobject-introspection-1.0/tests -I/usr/share/gobject-introspection-1.0/tests --filelist=/tmp/pip-install-din5wkr1/pygobject_4ee06742c5f541b7b3c892f5c4ab138f/.mesonpy-c0jm3tng/tests/libregress.so.p/Regress_1.0_gir_filelist --include=Gio-2.0 --include=cairo-1.0 --cflags-begin -I/usr/share/gobject-introspection-1.0/tests -I/usr/include/glib-2.0 -I/usr/lib64/glib-2.0/include -I/usr/include/sysprof-6 -I/usr/include/libmount -I/usr/include/blkid -I/usr/include/cairo -I/usr/include/freetype2 -I/usr/include/pixman-1 -I/usr/include/libxml2 -I/usr/include/harfbuzz -I/usr/include/libpng16 -I/usr/include/gobject-introspection-1.0 --cflags-end --add-include-path=/usr/share/gir-1.0 -L/tmp/pip-install-din5wkr1/pygobject_4ee06742c5f541b7b3c892f5c4ab138f/.mesonpy-c0jm3tng/tests --library regress -lglib-2.0 -lgobject-2.0 -lgio-2.0 -lgmodule-2.0 -lcairo -lcairo-gobject -lgirepository-1.0
Traceback (most recent call last):
File "/usr/bin/g-ir-scanner", line 99, in <module>
from giscanner.utils import dll_dirs
File "/usr/lib64/gobject-introspection/giscanner/__init__.py", line 29, in <module>
from . import gio_ast as ast
File "/usr/lib64/gobject-introspection/giscanner/gio_ast.py", line 27, in <module>
from . import message
File "/usr/lib64/gobject-introspection/giscanner/message.py", line 26, in <module>
from . import utils
File "/usr/lib64/gobject-introspection/giscanner/utils.py", line 385, in <module>
import distutils.cygwinccompiler
ModuleNotFoundError: No module named 'distutils'
[54/58] Compiling C object tests/libgimarshallingtests.so.p/_usr_share_gobject-introspection-1.0_tests_gimarshallingtests.c.o
ninja: build stopped: subcommand failed.
[end of output]
note: This error originates from a subprocess, and is likely not a problem with pip.
error: metadata-generation-failed
× Encountered error while generating package metadata.
╰─> See above for output.