Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork7.9k
Description
Summary
Thecairocffi
dependency was added to (Travis) CI to support thepgi
object bindings (0ed289c) that are no-longer-supported (3221c94).
However:cairocffi
will still be used ifcairo
(e.g.pycairo
) is unavailable at runtime:
matplotlib/lib/matplotlib/backends/backend_cairo.py
Lines 15 to 26 in6fc8169
try: | |
importcairo | |
ifcairo.version_info< (1,14,0):# Introduced set_device_scale. | |
raiseImportError(f"Cairo backend requires cairo>=1.14.0, " | |
f"but only{cairo.version_info} is available") | |
exceptImportError: | |
try: | |
importcairocffiascairo | |
exceptImportErroraserr: | |
raiseImportError( | |
"cairo backend requires that pycairo>=1.14.0 or cairocffi " | |
"is installed")fromerr |
We currently installcairocffi
during 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 separatecairocffi
-based GitHub Actions CI unit test matrix job, so that bothpycairo
andcairocffi
are exercised.
As a fallback if that proves infeasible, we could removecairocffi
from the dependencies installed during CI workflows.