Bug 1838162

Summary: python-matplotlib fails to build with Python 3.9: FAILED test_dviread.py::test_dviread - FileNotFoundError: missing font metric...
Product: [Fedora] Fedora Reporter: Miro Hrončok <mhroncok>
Component: python-matplotlibAssignee: Thomas Spura <tomspur>
Status: CLOSED NOTABUG QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: unspecified    
Version: rawhideCC: cstratak, dominik, gwync, jonathan.underwood, mhroncok, mplch, paulo.cesar.pereira.de.andrade, python-sig, quantum.analyst, thibault.north, tomspur
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2020-05-20 15:41:09 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1785415    

Description Miro Hrončok 2020-05-20 14:49:33 UTC
python-matplotlib fails to build with Python 3.9.0b1.

_________________________________ test_dviread _________________________________
[gw1] linux -- Python 3.9.0 /usr/bin/python3

    @pytest.mark.skipif(shutil.which("kpsewhich") is None,
                        reason="kpsewhich is not available")
    def test_dviread():
        dirpath = Path(__file__).parent / 'baseline_images/dviread'
        with (dirpath / 'test.json').open() as f:
            correct = json.load(f)
        with dr.Dvi(str(dirpath / 'test.dvi'), None) as dvi:
>           data = [{'text': [[t.x, t.y,
                               chr(t.glyph),
                               t.font.texname.decode('ascii'),
                               round(t.font.size, 2)]
                              for t in page.text],
                     'boxes': [[b.x, b.y, b.height, b.width] for b in page.boxes]}
                    for page in dvi]

../../BUILDROOT/python-matplotlib-3.2.1-1.fc33.x86_64/usr/lib64/python3.9/site-packages/matplotlib/tests/test_dviread.py:59: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 
../../BUILDROOT/python-matplotlib-3.2.1-1.fc33.x86_64/usr/lib64/python3.9/site-packages/matplotlib/tests/test_dviread.py:59: in <listcomp>
    data = [{'text': [[t.x, t.y,
../../BUILDROOT/python-matplotlib-3.2.1-1.fc33.x86_64/usr/lib64/python3.9/site-packages/matplotlib/dviread.py:243: in __iter__
    while self._read():
../../BUILDROOT/python-matplotlib-3.2.1-1.fc33.x86_64/usr/lib64/python3.9/site-packages/matplotlib/dviread.py:301: in _read
    self._dtable[byte](self, byte)
../../BUILDROOT/python-matplotlib-3.2.1-1.fc33.x86_64/usr/lib64/python3.9/site-packages/matplotlib/dviread.py:161: in wrapper
    return method(self, *[f(self, byte-min) for f in get_args])
../../BUILDROOT/python-matplotlib-3.2.1-1.fc33.x86_64/usr/lib64/python3.9/site-packages/matplotlib/dviread.py:441: in _fnt_def
    self._fnt_def_real(k, c, s, d, a, l)
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

self = <matplotlib.dviread.Dvi object at 0x7f80942bc670>, k = 7, c = 1274110073
s = 655360, d = 655360, a = 0, l = 5

    def _fnt_def_real(self, k, c, s, d, a, l):
        n = self.file.read(a + l)
        fontname = n[-l:].decode('ascii')
        tfm = _tfmfile(fontname)
        if tfm is None:
>           raise FileNotFoundError("missing font metrics file: %s" % fontname)
E           FileNotFoundError: missing font metrics file: cmr10

../../BUILDROOT/python-matplotlib-3.2.1-1.fc33.x86_64/usr/lib64/python3.9/site-packages/matplotlib/dviread.py:448: FileNotFoundError



This might be related to the new texlive that juts landed in rawhide, right?

Setting severity to high, because we'd liek to proceed with Koji rebuilds soon.


For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.9/fedora-rawhide-x86_64/01395396-python-matplotlib/

For all our attempts to build python-matplotlib with Python 3.9, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/package/python-matplotlib/

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.9:
https://copr.fedorainfracloud.org/coprs/g/python/python3.9/

Let us know here if you have any questions.

Python 3.9 will be included in Fedora 33. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.9.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires), so if this package is required a lot, it's important for us to get it fixed soon.
We'd appreciate help from the people who know this package best, but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2020-05-20 15:41:09 UTC
https://koschei.fedoraproject.org/package/python-matplotlib?collection=f33 indicates this is fixed. Closing here and triggered a rebuild.