Bugzilla – Bug 1218143
python2-pycairo is blocking update python-rpm-macros
Last modified: 2024-02-08 16:26:23 UTC
Created attachment 871412 [details] python2-pycairo_log.txt python-rpm-macros 20231204.dd64e74 (SR#1130671) is blocked by python2-pycairo failing to build. Most relevant part of the build log (attached): [ 12s] + xargs -0 /usr/bin/python2 -c ' [ 12s] import sys, py_compile [ 12s] for f in sys.argv[1:]: [ 12s] fp=f[len("/home/abuild/rpmbuild/BUILDROOT/python2-pycairo-1.18.1-6.20.x86_64"):] [ 12s] print(f"Generating cached byte-code for {fp}") [ 12s] for o in [0, 1]: [ 12s] py_compile.compile(f, dfile=fp, optimize=o) [ 12s] ' [ 12s] File "<string>", line 5 [ 12s] print(f"Generating cached byte-code for {fp}") [ 12s] ^ [ 12s] SyntaxError: invalid syntax [ 12s] error: Bad exit status from /var/tmp/rpm-tmp.LYEGW2 (%install) This seems to be using f-strings in python2.7 where they are not yet supported. The last update of python2-pycairo is from March 2020, so I'm wondering if this package is still maintained by upsteam. However, gimp, python-gobject2, python-gtk have a direct dependency on this package.
This code actually comes from python-rpm-macros, where it was already fixed upstream: https://github.com/openSUSE/python-rpm-macros/pull/167. pytho2-pycairo is by name the python2 compatible version of python-pycairo, which is alive. At the time it was probably a good decision to fork it. Wow, I didn't know we have so many python2-only packages still in our distro, even gimp. Maybe we could take a look whether they still need python2 and modernize them at some point.
Looks like it needs further fixing: [ 13s] + find /home/abuild/rpmbuild/BUILDROOT/python2-pycairo-1.18.1-6.57.x86_64/usr/lib64/python2.7/site-packages -iname '*.pyc' -delete [ 13s] + find /home/abuild/rpmbuild/BUILDROOT/python2-pycairo-1.18.1-6.57.x86_64/usr/lib64/python2.7/site-packages -iname '*.py' -print0 [ 13s] + xargs -0 /usr/bin/python2 -c ' [ 13s] import sys, py_compile [ 13s] for f in sys.argv[1:]: [ 13s] fp=f[len("/home/abuild/rpmbuild/BUILDROOT/python2-pycairo-1.18.1-6.57.x86_64"):] [ 13s] print("Generating cached byte-code for " + str(fp)) [ 13s] for o in [0, 1]: [ 13s] py_compile.compile(f, dfile=fp, optimize=o) [ 13s] ' [ 13s] Generating cached byte-code for /usr/lib64/python2.7/site-packages/cairo/__init__.py [ 13s] Traceback (most recent call last): [ 13s] File "<string>", line 7, in <module> [ 13s] TypeError: compile() got an unexpected keyword argument 'optimize' [ 13s] error: Bad exit status from /var/tmp/rpm-tmp.JyEZik (%install) [ 13s]
GIMP is firmly Python 2 until GIMP 3.0 releases. So we're stuck with python2-pycairo, and pygtk and a few others I forget until it does.
(In reply to Steve Kowalik from comment #3) > GIMP is firmly Python 2 until GIMP 3.0 releases. So we're stuck with > python2-pycairo, and pygtk and a few others I forget until it does. Wouldn't it be better to enable gimp pre-3.0 in Factory? https://build.opensuse.org/package/show/graphics:gimp:master/gimp looks like something real. Adding all involved into Cc: of this bug.
Could I ask about the current status of GIMP (2.99.16+git839.adb8f9dcb)? Wouldn’t it be possible to replace the stable gimp in Factory with this? What remains to be done?
https://www.gimp.org/downloads/devel/
(In reply to Matej Cepl from comment #5) > Could I ask about the current status of GIMP (2.99.16+git839.adb8f9dcb)? > Wouldn’t it be possible to replace the stable gimp in Factory with this? > What remains to be done? I don't think it's a good idea to remove stable GIMP from Tumbleweed. Although GIMP from master branch mostly works, IMHO Tumbleweed users deserve stable GIMP. FYI I tried to fix some of GIMP from master branch, but I'm not the main packager.
we have gimp master packages in the OBS already. https://build.opensuse.org/project/show/graphics:gimp:master but they also often require the master version of babl and gegl. not sure if we also want to bump those in TW all the time. But I mean we are lucky and gimp 3 will probably be released in 2024.
(In reply to Marcus Rückert from comment #8) > we have gimp master packages in the OBS already. > > https://build.opensuse.org/project/show/graphics:gimp:master > > but they also often require the master version of babl and gegl. not sure if > we also want to bump those in TW all the time. > > But I mean we are lucky and gimp 3 will probably be released in 2024. Does it mean that we can finally kill Python 2 in Factory?
if gimp really is the last thing sitting on it. then yes 2024 might become your lucky year.
discussion about preparing for gimp3 is now tracked here https://bugzilla.suse.com/show_bug.cgi?id=1218653
(In reply to Markéta Machová from comment #1) > This code actually comes from python-rpm-macros, where it was already fixed > upstream: https://github.com/openSUSE/python-rpm-macros/pull/167. > > pytho2-pycairo is by name the python2 compatible version of python-pycairo, > which is alive. At the time it was probably a good decision to fork it. Wow, > I didn't know we have so many python2-only packages still in our distro, > even gimp. Maybe we could take a look whether they still need python2 and > modernize them at some point. py2 drop tracked at https://bugzilla.opensuse.org/show_bug.cgi?id=1219306 As for this bug, as far as I can see: nothing left. the python-rpm-macros have been fixed to not break py2 packages,