svglib icon indicating copy to clipboard operation
svglib copied to clipboard

CI failure because of missing cairo

Open claudep opened this issue 2 years ago • 9 comments

Tests on GitHub CI fail currently because of missing cairo dependencies (and hence png output is not available).

claudep avatar Jun 24 '23 08:06 claudep

We may set reportlab[pycairo] in requirements.txt, but should we also add the ability to optionally install it, like reportlab, by using extra_require?

claudep avatar Jun 24 '23 08:06 claudep

We could set a hard dependecy on pycairo only for reportlab>=4.0.0 like mentioned in this example.

deeplook avatar Jun 24 '23 10:06 deeplook

My question was about keeping pycairo as optional even with recent reportlab. As cairo installation is not trivial on some platforms, maybe people who just want to use svglib to produce pdf (and no png), cairo installation may not be a hard dependency.

claudep avatar Jun 25 '23 09:06 claudep

Yes, I agree it should be optional with a hint about getting it installed for reportlab>=4 and the trouble to expect. Still, it would be nice to have it work inside github actions, though.

deeplook avatar Jun 25 '23 14:06 deeplook

The problem with actually using rlPyCairo (ie pycairo) is that pycairo does not build installable wheels for most platforms. That forces all the linux / unixy platforms to compile their own.

Part of the reason for splitting the bitmap stuff out of reportlab was to reduce the skills required to maintain it going forward. I can just about hack the github cibuildwheel stuff to obtain windows/manylinux/osx wheels which we did up to 4.0, but my continued participation is not guaranteed.

If testing is all that's needed then a good start would be

https://github.com/pygobject/pycairo/blob/main/.github/workflows/test.yml

which actually needs to build pycairo prior to testing it. Presumably svglib with reportlab+rlPyCairo would need to build/install libcairo(-dev), pycairo, rlPyCairo & reportlab.

I got very fed up with yml doing wheel building for reportlab, I have no doubt the same will be true for testing.

MrBitBucket avatar Jun 29 '23 08:06 MrBitBucket

@MrBitBucket I guess we could limit the tests run by GitHub actions only to those platforms known to work fine with pycairo. I remember I had some issues with it in a different context, but I forgot the details. I've tried to find out which warnings regarding pycairo I'd see in the installation descriptions in reportlab 4.x, and I could not find any in the archive I get from https://pypi.org/project/reportlab/#files (there is only a sentence naming pycairo as a dependency for bitmap images with text).

It seems somewhat unfortunate to me the the reportlab source code is not available on github or gitlab so it could be easy to comment and/or discuss. It might be on bitbucket, but I just failed to find it there, too...

deeplook avatar Jul 02 '23 08:07 deeplook

@deeplook, reportlab is hosted here: https://hg.reportlab.com/hg-public/reportlab/ with a mirror here: https://github.com/MrBitBucket/reportlab-mirror (thanks @MrBitBucket :-)) But no comments/discussions in either place (except the mailing list).

claudep avatar Jul 02 '23 08:07 claudep

@claudep @MrBitBucket I knew I had seen this repo before somewhere, but I was unable to find it quickly when I searched for it, indicating it's not easy to find from https://www.reportlab.com/support/, and in fact, I still cannot find that link anywhere. Searching on GitHub gives a lot of repos, but ok, maybe my bad.

Anyway, I think we should stop building on platforms that have issues with Cairo/PyCairo given https://github.com/pygobject/pycairo/issues/320, and "go green" again.

deeplook avatar Jul 13 '23 10:07 deeplook

How can we work around this if https://github.com/pygobject/pycairo/issues/320 is not moving forward?

deeplook avatar Aug 18 '23 06:08 deeplook