Summary
The cairocffi dependency was added to (Travis) CI to support the pgi object bindings (0ed289c) that are no-longer-supported (3221c94).
However: cairocffi will still be used if cairo (e.g. pycairo) is unavailable at runtime:
|
try: |
|
import cairo |
|
if cairo.version_info < (1, 14, 0): # Introduced set_device_scale. |
|
raise ImportError(f"Cairo backend requires cairo>=1.14.0, " |
|
f"but only {cairo.version_info} is available") |
|
except ImportError: |
|
try: |
|
import cairocffi as cairo |
|
except ImportError as err: |
|
raise ImportError( |
|
"cairo backend requires that pycairo>=1.14.0 or cairocffi " |
|
"is installed") from err |
We currently install cairocffi during GitHub Actions CI unit testing; so there is a possibility that it would mask failures to import and exercise pycairo-based test coverage.
NB: This is my current understanding as I explore #29732 - I'm not 100% confident about my findings.
Proposed fix
Ideally, I think we should extract a separate cairocffi-based GitHub Actions CI unit test matrix job, so that both pycairo and cairocffi are exercised.
As a fallback if that proves infeasible, we could remove cairocffi from the dependencies installed during CI workflows.
Summary
The
cairocffidependency was added to (Travis) CI to support thepgiobject bindings (0ed289c) that are no-longer-supported (3221c94).However:
cairocffiwill still be used ifcairo(e.g.pycairo) is unavailable at runtime:matplotlib/lib/matplotlib/backends/backend_cairo.py
Lines 15 to 26 in 6fc8169
We currently install
cairocffiduring GitHub Actions CI unit testing; so there is a possibility that it would mask failures to import and exercisepycairo-based test coverage.NB: This is my current understanding as I explore #29732 - I'm not 100% confident about my findings.
Proposed fix
Ideally, I think we should extract a separate
cairocffi-based GitHub Actions CI unit test matrix job, so that bothpycairoandcairocffiare exercised.As a fallback if that proves infeasible, we could remove
cairocffifrom the dependencies installed during CI workflows.