Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Backport fixes from #28711 #28724

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 11 additions & 3 deletions lib/matplotlib/tests/test_backends_interactive.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,18 @@
elif env["MPLBACKEND"] == 'macosx' and os.environ.get('TF_BUILD'):
reason = "macosx backend fails on Azure"
elif env["MPLBACKEND"].startswith('gtk'):
import gi # type: ignore
try:
import gi # type: ignore
except ImportError:

Check warning on line 86 in lib/matplotlib/tests/test_backends_interactive.py

View check run for this annotation

Codecov / codecov/patch

lib/matplotlib/tests/test_backends_interactive.py#L86

Added line #L86 was not covered by tests
# Though we check that `gi` exists above, it is possible that its
# C-level dependencies are not available, and then it still raises an
# `ImportError`, so guard against that.
available_gtk_versions = []

Check warning on line 90 in lib/matplotlib/tests/test_backends_interactive.py

View check run for this annotation

Codecov / codecov/patch

lib/matplotlib/tests/test_backends_interactive.py#L90

Added line #L90 was not covered by tests
else:
gi_repo = gi.Repository.get_default()
available_gtk_versions = gi_repo.enumerate_versions('Gtk')
version = env["MPLBACKEND"][3]
repo = gi.Repository.get_default()
if f'{version}.0' not in repo.enumerate_versions('Gtk'):
if f'{version}.0' not in available_gtk_versions:
reason = "no usable GTK bindings"
marks = []
if reason:
Expand Down
4 changes: 2 additions & 2 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ requires-python = ">=3.9"
dev = [
"meson-python>=0.13.1",
"numpy>=1.25",
"pybind11>=2.6",
"pybind11>=2.6,!=2.13.3",
"setuptools_scm>=7",
# Not required by us but setuptools_scm without a version, cso _if_
# installed, then setuptools_scm 8 requires at least this version.
Expand All @@ -73,7 +73,7 @@ build-backend = "mesonpy"
# Also keep in sync with optional dependencies above.
requires = [
"meson-python>=0.13.1",
"pybind11>=2.6",
"pybind11>=2.6,!=2.13.3",
"setuptools_scm>=7",

# Comments on numpy build requirement range:
Expand Down
Loading