Bug 1717658 - pycairo fails to build with Python 3.8
Summary: pycairo fails to build with Python 3.8
Keywords:
Status: CLOSED RAWHIDE
Alias: None
Product: Fedora
Classification: Fedora
Component: pycairo
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
urgent
Target Milestone: ---
Assignee: Ralph Bean
QA Contact: Fedora Extras Quality Assurance
URL: https://copr.fedorainfracloud.org/cop...
Whiteboard:
Depends On:
Blocks: PYTHON38
TreeView+ depends on / blocked
 
Reported: 2019-06-05 21:44 UTC by Miro Hrončok
Modified: 2019-06-20 07:01 UTC (History)
10 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-06-20 07:01:38 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

Description Miro Hrončok 2019-06-05 21:44:20 UTC
pycairo fails to build with Python 3.8.0b1. See https://copr.fedorainfracloud.org/coprs/g/python/python3.8/package/pycairo/ for actual logs. This report is automated and not very verbose, but I'll get back here with details.

Comment 1 Miro Hrončok 2019-06-05 21:53:11 UTC
=================================== FAILURES ===================================
__________________________________ test_type ___________________________________

    @pytest.mark.skipif(platform.python_implementation() == "PyPy", reason="PyPy")
    def test_type():
        t = cairo.Antialias
        assert int in t.__mro__
        assert isinstance(t(42), int)
        assert isinstance(t(0), int)
        assert issubclass(t, int)
    
        with pytest.raises(TypeError):
            t()
    
        with pytest.raises(TypeError):
            t(object())
    
        with pytest.raises(TypeError):
            type("foo", (t,), {})
    
        assert hasattr(t, "DEFAULT")
        assert t.DEFAULT == 0
        assert t.__name__ == "Antialias"
        assert t.__module__ == "cairo"
    
        assert repr(t.DEFAULT) == "cairo.Antialias.DEFAULT"
        assert repr(t(123456)) == "123456"
        assert repr(t(0)) == "cairo.Antialias.DEFAULT"
>       assert str(t(0)) == "0"
E       AssertionError: assert 'cairo.Antialias.DEFAULT' == '0'
E         - cairo.Antialias.DEFAULT
E         + 0

tests/test_enums.py:35: AssertionError
=============== 1 failed, 258 passed, 4 skipped in 1.49 seconds ================

Comment 2 Miro Hrončok 2019-06-10 16:42:39 UTC
This issue is blocking the Python 3.8 rebuilds. If this package won't build with 3.8, it won't be installable, along with all its dependent packages, after the side tag is merged.
Furthermore, as it fails to install, its dependent packages will fail to install and/or build as well. The fix should be pushed on the master branch and no release bump is required.

Testing and mass rebuild of packages is happening in copr. You can follow these instructions to test locally in mock if your package builds with Python 3.8: https://copr.fedorainfracloud.org/coprs/g/python/python3.8/

This issue needs to be resolved by next week, if other rebuilds of Python 3.8 beta 1 go well. If this is unrealistic for you, let us know how much time you need.

If you don't have free cycles to dedicate fixing your package, notify us and we'll try to provide some pointers. Let us know if we can push a fix directly without a pull request, in the case we happen to have one before you do.

We recommend always consulting with upstream, chances are this is already fixed there.

Comment 3 Miro Hrončok 2019-06-17 09:39:38 UTC
This issue is blocking the Python 3.8 rebuilds. This package is part of the first 500 packages we build to bootstrap everything else. pygobject3 needs it to build.

Unless this is resolved, we cannot proceed with the side tag rebuilds.

Comment 4 Petr Viktorin (pviktori) 2019-06-19 13:22:39 UTC
This is due to a change in Python 3.8 (https://docs.python.org/3.8/whatsnew/3.8.html#changes-in-python-behavior):

Removed __str__ implementations from builtin types bool, int, float, complex and few classes from the standard library. They now inherit __str__() from object. As result, defining the __repr__() method in the subclass of these classes will affect they string representation. (Contributed by Serhiy Storchaka in bpo-36793.)

Comment 5 Miro Hrončok 2019-06-19 13:23:47 UTC
This has been fixed upstream in https://github.com/pygobject/pycairo/commit/71c81741495cdce132b6f45a0f596d70909c1e4d

It was not released yet.


Note You need to log in before you can comment on or make changes to this bug.