Skip to content

Commit

Permalink
build: manually add matplotlib dep
Browse files Browse the repository at this point in the history
  • Loading branch information
maxim-v4s committed Dec 27, 2024
1 parent ce81682 commit 67628cb
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
1 change: 1 addition & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ networkx = "~3.2.0" # max available version with python 3.9 support
jsonpointer = "^3.0.0"
types-networkx = "~3.2.1.20240918"
datamodel-code-generator = "^0.26.3"
matplotlib = "^3.9.4"


[tool.poetry.group.test.dependencies]
Expand Down
10 changes: 8 additions & 2 deletions qualibrate/qualibration_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,10 @@
)

import matplotlib
from matplotlib.rcsetup import interactive_bk
from matplotlib.backends import ( # type: ignore[attr-defined]
BackendFilter,
backend_registry,
)
from pydantic import ValidationError, create_model

from qualibrate.config.utils import get_qualibrate_app_settings
Expand Down Expand Up @@ -263,7 +266,10 @@ def _warn_if_external_and_interactive_mpl(self) -> None:
"""
mpl_backend = matplotlib.get_backend()
if self.modes.external and mpl_backend in interactive_bk:
if self.modes.external and mpl_backend in cast(
list[str],
backend_registry.list_builtin(BackendFilter.INTERACTIVE), # type: ignore[no-untyped-call]
):
matplotlib.use("agg")
logger.warning(
f"Using interactive matplotlib backend '{mpl_backend}' in "
Expand Down

0 comments on commit 67628cb

Please sign in to comment.