Skip to content

Conversation

@naveen521kk
Copy link
Contributor

@naveen521kk naveen521kk commented Oct 21, 2021

@naveen521kk naveen521kk force-pushed the build-cairo-new branch 5 times, most recently from 14dd62d to 8649126 Compare October 21, 2021 14:28
@naveen521kk naveen521kk force-pushed the build-cairo-new branch 10 times, most recently from c599b09 to 482720a Compare November 7, 2021 16:50
@naveen521kk naveen521kk closed this Mar 7, 2022
@naveen521kk naveen521kk reopened this Mar 7, 2022
@naveen521kk
Copy link
Contributor Author

Now that Cairo 1.17.6 is out I'll try this PR with that version.

@naveen521kk naveen521kk changed the title Refactor setup.py to use setuptools + Build cairo if not avaiable Update cairo bundled in windows wheels Mar 19, 2022
@naveen521kk
Copy link
Contributor Author

It's getting fun: the tests are failing with a MemoryError (???).

___________________________ test_show_unicode_text ____________________________

    def test_show_unicode_text():
        width, height = 300, 300
        surface = cairo.ImageSurface(cairo.FORMAT_ARGB32, width, height)
        ctx = cairo.Context(surface)
    
        ctx.scale(width, height)
        ctx.set_line_width(0.04)
    
        ctx.select_font_face(
>           "Sans", cairo.FONT_SLANT_NORMAL, cairo.FONT_WEIGHT_NORMAL)
E       tests.test_api.cairo.MemoryError: out of memory

tests\test_api.py:48: cairo.MemoryError
____________________________ test_show_text_glyphs ____________________________

    @pytest.mark.skipif(platform.python_implementation() == "PyPy", reason="PyPy")
    def test_show_text_glyphs():
        surface = cairo.PDFSurface(None, 300, 300)
        context = cairo.Context(surface)
        context.scale(300, 300)
        context.select_font_face("Sans", cairo.FONT_SLANT_NORMAL,
>                                cairo.FONT_WEIGHT_NORMAL)
E       tests.test_context.cairo.MemoryError: out of memory

tests\test_context.py:67: cairo.MemoryError
_____________________ test_svg_surface_get_document_unit ______________________

    @pytest.mark.skipif(not hasattr(cairo.SVGSurface, "get_document_unit"),
                        reason="too old cairo")
    def test_svg_surface_get_document_unit():
        with cairo.SVGSurface(None, 10, 10) as surface:
>           assert surface.get_document_unit() == cairo.SVGUnit.PT
E           AssertionError: assert cairo.SVGUnit.USER == cairo.SVGUnit.PT
E            +  where cairo.SVGUnit.USER = <built-in method get_document_unit of cairo.SVGSurface object at 0x0000018C55CD52B0>()
E            +    where <built-in method get_document_unit of cairo.SVGSurface object at 0x0000018C55CD52B0> = <cairo.SVGSurface object at 0x0000018C55CD52B0>.get_document_unit
E            +  and   cairo.SVGUnit.PT = <class 'cairo.SVGUnit'>.PT
E            +    where <class 'cairo.SVGUnit'> = cairo.SVGUnit

tests\test_surface.py:270: AssertionError
_________________________ test_pdf_version_to_string __________________________

    def test_pdf_version_to_string():
        ver = cairo.PDFSurface.version_to_string(cairo.PDF_VERSION_1_4)
        assert ver and isinstance(ver, str)
        with pytest.raises(ValueError):
>           cairo.PDFSurface.version_to_string(-1)
E           Failed: DID NOT RAISE <class 'ValueError'>

tests\test_surface.py:303: Failed

@naveen521kk
Copy link
Contributor Author

there's only one error now after updating release with the patch related to dwrite: pygobject/cairo-win-build@0f53b7d

_________________________ test_pdf_version_to_string __________________________
    def test_pdf_version_to_string():
        ver = cairo.PDFSurface.version_to_string(cairo.PDF_VERSION_1_4)
        assert ver and isinstance(ver, str)
        with pytest.raises(ValueError):
>           cairo.PDFSurface.version_to_string(-1)
E           Failed: DID NOT RAISE <class 'ValueError'>
tests\test_surface.py:306: Failed
=========================== short test summary info ===========================
FAILED tests/test_surface.py::test_pdf_version_to_string - Failed: DID NOT RA...
================== 1 failed, 269 passed, 5 skipped in 22.47s ==================

@naveen521kk naveen521kk force-pushed the build-cairo-new branch 4 times, most recently from 9b14be4 to e7e3495 Compare September 17, 2022 14:37
@naveen521kk naveen521kk marked this pull request as ready for review September 17, 2022 14:40
- Closes pygobject#242.
- Use a prebuilt version of Cairo from https://github.com/pygobject/cairo-win-build, https://github.com/pygobject/cairo-win-build/releases/tag/1.17.6. It's a static build of Cairo.
- Use pkg-config for finding build flags even on Windows/MSVC compiler.
- Build and test wheels using [cibuildwheel](https://cibuildwheel.readthedocs.io) for Windows.
… option

`PYCAIRO_BUILD_NO_PKGCONFIG, used when we shouldn't use pkg-config

`PYCAIRO_BUILD_MSVC_STATIC`: used when we are building with static
libraries of cairo defaults to True.
@lazka lazka closed this Nov 27, 2022
@lazka lazka reopened this Nov 27, 2022
@lazka lazka merged commit 1979d1d into pygobject:main Nov 27, 2022
@naveen521kk naveen521kk deleted the build-cairo-new branch November 27, 2022 18:43
@naveen521kk
Copy link
Contributor Author

Thanks!

@lazka
Copy link
Member

lazka commented Nov 28, 2022

thank you! sorry for the delay

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

clip_preserve()-related drawing bug on Windows

3 participants