Skip to content

Commit ee7bda8

Browse files
authored
Merge pull request #28724 from QuLogic/backport-fixes
Backport fixes from #28711
2 parents d04b2f6 + f6b3266 commit ee7bda8

File tree

2 files changed

+13
-5
lines changed

2 files changed

+13
-5
lines changed

lib/matplotlib/tests/test_backends_interactive.py

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -81,10 +81,18 @@ def _get_available_interactive_backends():
8181
elif env["MPLBACKEND"] == 'macosx' and os.environ.get('TF_BUILD'):
8282
reason = "macosx backend fails on Azure"
8383
elif env["MPLBACKEND"].startswith('gtk'):
84-
import gi # type: ignore
84+
try:
85+
import gi # type: ignore
86+
except ImportError:
87+
# Though we check that `gi` exists above, it is possible that its
88+
# C-level dependencies are not available, and then it still raises an
89+
# `ImportError`, so guard against that.
90+
available_gtk_versions = []
91+
else:
92+
gi_repo = gi.Repository.get_default()
93+
available_gtk_versions = gi_repo.enumerate_versions('Gtk')
8594
version = env["MPLBACKEND"][3]
86-
repo = gi.Repository.get_default()
87-
if f'{version}.0' not in repo.enumerate_versions('Gtk'):
95+
if f'{version}.0' not in available_gtk_versions:
8896
reason = "no usable GTK bindings"
8997
marks = []
9098
if reason:

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ requires-python = ">=3.9"
4949
dev = [
5050
"meson-python>=0.13.1",
5151
"numpy>=1.25",
52-
"pybind11>=2.6",
52+
"pybind11>=2.6,!=2.13.3",
5353
"setuptools_scm>=7",
5454
# Not required by us but setuptools_scm without a version, cso _if_
5555
# installed, then setuptools_scm 8 requires at least this version.
@@ -73,7 +73,7 @@ build-backend = "mesonpy"
7373
# Also keep in sync with optional dependencies above.
7474
requires = [
7575
"meson-python>=0.13.1",
76-
"pybind11>=2.6",
76+
"pybind11>=2.6,!=2.13.3",
7777
"setuptools_scm>=7",
7878

7979
# Comments on numpy build requirement range:

0 commit comments

Comments
 (0)