svglib icon indicating copy to clipboard operation
svglib copied to clipboard

Make pycairo optional

Open pascalfree opened this issue 3 months ago • 6 comments

In some (many?) use cases, generating bitmaps is not needed, making the installation of cairo unnecessary. However since v1.6 the installation of svglib will fail, if cairo is not installed on the system.

Could pycairo be made an optional dependency to let the users choose if they need it or not? Reportlab follows that approach already: https://docs.reportlab.com/install/open_source_installation/

For the time being, we are stuck with v1.5.1 because of this issue.

pascalfree avatar Oct 05 '25 08:10 pascalfree

Thank you for raising your first issue! Your help to improve svglib is much appreciated!

github-actions[bot] avatar Oct 05 '25 08:10 github-actions[bot]

FWIW, I think it would be a good thing.

claudep avatar Oct 05 '25 18:10 claudep

That makes a lot of sense. Cairo is basically solving the previous issues with libart when creating bitmaps. I'll look into it. Be aware that 1.6.0 was intended to be a "make-over" release without introducing new features.

deeplook avatar Oct 06 '25 10:10 deeplook

+1 sticking with 1.5.1 because of pycairo requirement

codedoga avatar Oct 06 '25 17:10 codedoga

+1 sticking with 1.5.1 because of pycairo requirement

Our main reason for using svglib is that it did not include cairo. We'll also be pinning.

georgedeath avatar Oct 21 '25 09:10 georgedeath

We use SVGLib through other sub deps. We also pinned to 1.5.1 during upgrade. pycairo does not provide wheels for linux (explicitly).

I think that adding an heavy library that -explictly- requires changes to CI, CD and Host systems to run with native bindings (cairo) is terrible to do between "minor" upgrades. This is something I expect from a major change, like 2.0.0.

+1 on making it optional!

alexmaurizio avatar Dec 10 '25 15:12 alexmaurizio