Skip to content

python-ufo2ft FTBFS #113

@CoelacanthusHex

Description

@CoelacanthusHex

Need cherry-pick googlefonts/ufo2ft@35f868c and googlefonts/ufo2ft@43bd996 to fix test failed.

Details
=================================== FAILURES ===================================
_________________________ test_kern_zyyy_zinh[defcon] __________________________

snapshot = '''
lookup kern_dflt {
    lookupflag IgnoreMarks;
    pos uni0300 uni0300 0;
    pos uni0310 uni0310 1;
    pos uni03...a;
    language dflt;
    lookup kern_dflt;
    
    script dupl;
    language dflt;
    lookup kern_dflt;
} dist;

'''
FontClass = <class 'defcon.objects.font.Font'>

    def test_kern_zyyy_zinh(snapshot, FontClass):
        """Test that a sampling of glyphs with a common or inherited script, but a
        disjoint set of explicit script extensions end up in the correct lookups."""
        glyphs = {}
        for i in range(0, 0x110000, 0x10):
            script = unicodeScript(i)
            script_extension = unicodeScriptExtensions(i)
            if script not in script_extension:
                assert script in DFLT_SCRIPTS
                name = f"uni{i:04X}"
                glyphs[name] = i
        kerning = {(glyph, glyph): i for i, glyph in enumerate(glyphs)}
        ufo = makeUFO(FontClass, glyphs, None, kerning)
        newFeatures = KernFeatureWriterTest.writeFeatures(ufo)
    
>       assert newFeatures.asFea() == snapshot
E       AssertionError: assert [+ received] == [- snapshot]
E           '''
E             ...
E               pos uni0310 uni0310 1;
E         -     pos uni0320 uni0320 2;
E         -     pos uni0330 uni0330 3;
E         +     pos uni0330 uni0330 2;
E         -     pos uni0640 uni0640 4;...
E         
E         ...Full output truncated (86 lines hidden), use '-vv' to show

tests/featureWriters/kernFeatureWriter2_test.py:985: AssertionError
_________________________ test_kern_zyyy_zinh[defcon] __________________________

FontClass = <class 'defcon.objects.font.Font'>

    def test_kern_zyyy_zinh(FontClass):
        """Test that a sampling of glyphs with a common or inherited script, but a
        disjoint set of explicit script extensions end up in the correct lookups."""
        glyphs = {}
        for i in range(0, 0x110000, 0x10):
            script = unicodeScript(i)
            script_extension = unicodeScriptExtensions(i)
            if script not in script_extension:
                assert script in DFLT_SCRIPTS
                name = f"uni{i:04X}"
                glyphs[name] = i
        kerning = {(glyph, glyph): i for i, glyph in enumerate(glyphs)}
        ufo = makeUFO(FontClass, glyphs, None, kerning)
        newFeatures = KernFeatureWriterTest.writeFeatures(ufo)
    
>       assert dedent(str(newFeatures)) == dedent(
            """\
            lookup kern_Deva {
                lookupflag IgnoreMarks;
                pos uni1CD0 uni1CD0 7;
                pos uni1CE0 uni1CE0 8;
                pos uni1CF0 uni1CF0 9;
                pos uni20F0 uni20F0 11;
                pos uniA830 uniA830 34;
            } kern_Deva;
    
            lookup kern_Dupl {
                lookupflag IgnoreMarks;
                pos uni1BCA0 uni1BCA0 42;
            } kern_Dupl;
    
            lookup kern_Grek {
                lookupflag IgnoreMarks;
                pos uni0300 uni0300 0;
                pos uni1DC0 uni1DC0 10;
            } kern_Grek;
    
            lookup kern_Hani_Hrkt {
                lookupflag IgnoreMarks;
                pos uni1D360 uni1D360 43;
                pos uni1D370 uni1D370 44;
                pos uni1F250 uni1F250 45;
                pos uni2FF0 uni2FF0 13;
                pos uni3010 uni3010 14;
                pos uni3030 uni3030 15;
                pos uni30A0 uni30A0 16;
                pos uni3190 uni3190 17;
                pos uni31C0 uni31C0 18;
                pos uni31D0 uni31D0 19;
                pos uni31E0 uni31E0 20;
                pos uni3220 uni3220 21;
                pos uni3230 uni3230 22;
                pos uni3240 uni3240 23;
                pos uni3280 uni3280 24;
                pos uni3290 uni3290 25;
                pos uni32A0 uni32A0 26;
                pos uni32B0 uni32B0 27;
                pos uni32C0 uni32C0 28;
                pos uni3360 uni3360 29;
                pos uni3370 uni3370 30;
                pos uni33E0 uni33E0 31;
                pos uni33F0 uni33F0 32;
                pos uniA700 uniA700 33;
                pos uniFF70 uniFF70 35;
            } kern_Hani_Hrkt;
    
            lookup kern_Default {
                lookupflag IgnoreMarks;
                pos uni0310 uni0310 1;
                pos uni0320 uni0320 2;
                pos uni0330 uni0330 3;
                pos uni0640 uni0640 4;
                pos uni0650 uni0650 5;
                pos uni0670 uni0670 6;
                pos uni10100 uni10100 36;
                pos uni10110 uni10110 37;
                pos uni10120 uni10120 38;
                pos uni10130 uni10130 39;
                pos uni102E0 uni102E0 40;
                pos uni102F0 uni102F0 41;
                pos uni2E30 uni2E30 12;
            } kern_Default;
    
            feature kern {
                script DFLT;
                language dflt;
                lookup kern_Default;
                lookup kern_Grek;
                lookup kern_Hani_Hrkt;
    
                script grek;
                language dflt;
                lookup kern_Default;
                lookup kern_Grek;
    
                script hani;
                language dflt;
                lookup kern_Default;
                lookup kern_Hani_Hrkt;
    
                script kana;
                language dflt;
                lookup kern_Default;
                lookup kern_Hani_Hrkt;
            } kern;
    
            feature dist {
                script dev2;
                language dflt;
                lookup kern_Default;
                lookup kern_Deva;
    
                script deva;
                language dflt;
                lookup kern_Default;
                lookup kern_Deva;
    
                script dupl;
                language dflt;
                lookup kern_Default;
                lookup kern_Dupl;
            } dist;
            """
        )
E       AssertionError: assert 'lookup kern_...l;\n} dist;\n' == 'lookup kern_...l;\n} dist;\n'
E         
E         Skipping 61 identical leading characters in diff, use -v to show
E         - 0 uni1CD0 7;
E         ?           ^
E         + 0 uni1CD0 6;
E         ?           ^
E         -     pos uni1CE0 uni1CE0 8;...
E         
E         ...Full output truncated (227 lines hidden), use '-vv' to show

tests/featureWriters/kernFeatureWriter_test.py:1855: AssertionError
_________________________ test_kern_zyyy_zinh[ufoLib2] _________________________

snapshot = '''
lookup kern_dflt {
    lookupflag IgnoreMarks;
    pos uni0300 uni0300 0;
    pos uni0310 uni0310 1;
    pos uni03...a;
    language dflt;
    lookup kern_dflt;
    
    script dupl;
    language dflt;
    lookup kern_dflt;
} dist;

'''
FontClass = <function FontClass.<locals>.ctor at 0x7f2862e12020>

    def test_kern_zyyy_zinh(snapshot, FontClass):
        """Test that a sampling of glyphs with a common or inherited script, but a
        disjoint set of explicit script extensions end up in the correct lookups."""
        glyphs = {}
        for i in range(0, 0x110000, 0x10):
            script = unicodeScript(i)
            script_extension = unicodeScriptExtensions(i)
            if script not in script_extension:
                assert script in DFLT_SCRIPTS
                name = f"uni{i:04X}"
                glyphs[name] = i
        kerning = {(glyph, glyph): i for i, glyph in enumerate(glyphs)}
        ufo = makeUFO(FontClass, glyphs, None, kerning)
        newFeatures = KernFeatureWriterTest.writeFeatures(ufo)
    
>       assert newFeatures.asFea() == snapshot
E       AssertionError: assert [+ received] == [- snapshot]
E           '''
E             ...
E               pos uni0310 uni0310 1;
E         -     pos uni0320 uni0320 2;
E         -     pos uni0330 uni0330 3;
E         +     pos uni0330 uni0330 2;
E         -     pos uni0640 uni0640 4;...
E         
E         ...Full output truncated (86 lines hidden), use '-vv' to show

tests/featureWriters/kernFeatureWriter2_test.py:985: AssertionError
_________________________ test_kern_zyyy_zinh[ufoLib2] _________________________

FontClass = <function FontClass.<locals>.ctor at 0x7f2862e12020>

    def test_kern_zyyy_zinh(FontClass):
        """Test that a sampling of glyphs with a common or inherited script, but a
        disjoint set of explicit script extensions end up in the correct lookups."""
        glyphs = {}
        for i in range(0, 0x110000, 0x10):
            script = unicodeScript(i)
            script_extension = unicodeScriptExtensions(i)
            if script not in script_extension:
                assert script in DFLT_SCRIPTS
                name = f"uni{i:04X}"
                glyphs[name] = i
        kerning = {(glyph, glyph): i for i, glyph in enumerate(glyphs)}
        ufo = makeUFO(FontClass, glyphs, None, kerning)
        newFeatures = KernFeatureWriterTest.writeFeatures(ufo)
    
>       assert dedent(str(newFeatures)) == dedent(
            """\
            lookup kern_Deva {
                lookupflag IgnoreMarks;
                pos uni1CD0 uni1CD0 7;
                pos uni1CE0 uni1CE0 8;
                pos uni1CF0 uni1CF0 9;
                pos uni20F0 uni20F0 11;
                pos uniA830 uniA830 34;
            } kern_Deva;
    
            lookup kern_Dupl {
                lookupflag IgnoreMarks;
                pos uni1BCA0 uni1BCA0 42;
            } kern_Dupl;
    
            lookup kern_Grek {
                lookupflag IgnoreMarks;
                pos uni0300 uni0300 0;
                pos uni1DC0 uni1DC0 10;
            } kern_Grek;
    
            lookup kern_Hani_Hrkt {
                lookupflag IgnoreMarks;
                pos uni1D360 uni1D360 43;
                pos uni1D370 uni1D370 44;
                pos uni1F250 uni1F250 45;
                pos uni2FF0 uni2FF0 13;
                pos uni3010 uni3010 14;
                pos uni3030 uni3030 15;
                pos uni30A0 uni30A0 16;
                pos uni3190 uni3190 17;
                pos uni31C0 uni31C0 18;
                pos uni31D0 uni31D0 19;
                pos uni31E0 uni31E0 20;
                pos uni3220 uni3220 21;
                pos uni3230 uni3230 22;
                pos uni3240 uni3240 23;
                pos uni3280 uni3280 24;
                pos uni3290 uni3290 25;
                pos uni32A0 uni32A0 26;
                pos uni32B0 uni32B0 27;
                pos uni32C0 uni32C0 28;
                pos uni3360 uni3360 29;
                pos uni3370 uni3370 30;
                pos uni33E0 uni33E0 31;
                pos uni33F0 uni33F0 32;
                pos uniA700 uniA700 33;
                pos uniFF70 uniFF70 35;
            } kern_Hani_Hrkt;
    
            lookup kern_Default {
                lookupflag IgnoreMarks;
                pos uni0310 uni0310 1;
                pos uni0320 uni0320 2;
                pos uni0330 uni0330 3;
                pos uni0640 uni0640 4;
                pos uni0650 uni0650 5;
                pos uni0670 uni0670 6;
                pos uni10100 uni10100 36;
                pos uni10110 uni10110 37;
                pos uni10120 uni10120 38;
                pos uni10130 uni10130 39;
                pos uni102E0 uni102E0 40;
                pos uni102F0 uni102F0 41;
                pos uni2E30 uni2E30 12;
            } kern_Default;
    
            feature kern {
                script DFLT;
                language dflt;
                lookup kern_Default;
                lookup kern_Grek;
                lookup kern_Hani_Hrkt;
    
                script grek;
                language dflt;
                lookup kern_Default;
                lookup kern_Grek;
    
                script hani;
                language dflt;
                lookup kern_Default;
                lookup kern_Hani_Hrkt;
    
                script kana;
                language dflt;
                lookup kern_Default;
                lookup kern_Hani_Hrkt;
            } kern;
    
            feature dist {
                script dev2;
                language dflt;
                lookup kern_Default;
                lookup kern_Deva;
    
                script deva;
                language dflt;
                lookup kern_Default;
                lookup kern_Deva;
    
                script dupl;
                language dflt;
                lookup kern_Default;
                lookup kern_Dupl;
            } dist;
            """
        )
E       AssertionError: assert 'lookup kern_...l;\n} dist;\n' == 'lookup kern_...l;\n} dist;\n'
E         
E         Skipping 61 identical leading characters in diff, use -v to show
E         - 0 uni1CD0 7;
E         ?           ^
E         + 0 uni1CD0 6;
E         ?           ^
E         -     pos uni1CE0 uni1CE0 8;...
E         
E         ...Full output truncated (227 lines hidden), use '-vv' to show

tests/featureWriters/kernFeatureWriter_test.py:1855: AssertionError
=============================== warnings summary ===============================
../../../../usr/lib/python3.13/site-packages/fs/__init__.py:4
  /usr/lib/python3.13/site-packages/fs/__init__.py:4: UserWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html. The pkg_resources package is slated for removal as early as 2025-11-30. Refrain from using this package or pin to Setuptools<81.
    __import__("pkg_resources").declare_namespace(__name__)  # type: ignore

tests/filters/dottedCircle_test.py::test_empty_font_deprecated[defcon]
  /build/python-ufo2ft/src/ufo2ft-3.6.9/build/lib/ufo2ft/filters/dottedCircleFilter.py:8: UserWarning: The dottedCircleFilter module is deprecated, please import dottedCircle instead.
    warnings.warn(

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
--------------------------- snapshot report summary ----------------------------
1 snapshot failed. 40 snapshots passed.
=========================== short test summary info ============================
FAILED tests/featureWriters/kernFeatureWriter2_test.py::test_kern_zyyy_zinh[defcon]
FAILED tests/featureWriters/kernFeatureWriter_test.py::test_kern_zyyy_zinh[defcon]
FAILED tests/featureWriters/kernFeatureWriter2_test.py::test_kern_zyyy_zinh[ufoLib2]
FAILED tests/featureWriters/kernFeatureWriter_test.py::test_kern_zyyy_zinh[ufoLib2]
================== 4 failed, 1194 passed, 2 warnings in 9.44s ==================

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions