Skip to content
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
26 changes: 19 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,12 @@ jobs:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13t"]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
include:
#- os: macos-latest
# python-version: "3.14"
- os: windows-latest
python-version: "3.14"

steps:
- name: Checkout
Expand All @@ -36,22 +41,29 @@ jobs:
- name: Install package with test dependencies
run: pip install .[test]

- name: Test installation with nbdime
if: ${{ matrix.python-version != '3.9' }}
run: pytest -v --nbdime

- name: Test installation without nbdime
if: ${{ matrix.python-version == '3.9' }}
run: pytest -v

- name: Test flake8
if: ${{ matrix.python-version == '3.14' }}
run: flake8 matplotlib_inline --ignore=E501,W504,W503

- name: Install ruff
run: mamba install ruff
if: ${{ matrix.python-version == '3.14' }}
run: pip install ruff

- name: Check code with ruff
if: ${{ matrix.python-version == '3.14' }}
run: ruff check matplotlib_inline

- name: Check formatting with ruff
if: ${{ matrix.python-version == '3.14' }}
run: ruff format matplotlib_inline --check

- name: install Mypy
if: ${{ matrix.python-version == '3.14' }}
run : pip install mypy matplotlib

- name: run mypy
if: ${{ matrix.python-version == '3.14' }}
run: mypy .
15 changes: 7 additions & 8 deletions matplotlib_inline/backend_inline.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,16 @@
# Distributed under the terms of the BSD 3-Clause License.

import matplotlib
from IPython.core.getipython import get_ipython
from IPython.core.interactiveshell import InteractiveShell
from IPython.core.pylabtools import select_figure_formats
from IPython.display import display
from matplotlib import colors
from matplotlib._pylab_helpers import Gcf
from matplotlib.backends import backend_agg
from matplotlib.backends.backend_agg import FigureCanvasAgg
from matplotlib._pylab_helpers import Gcf
from matplotlib.figure import Figure

from IPython.core.interactiveshell import InteractiveShell
from IPython.core.getipython import get_ipython
from IPython.core.pylabtools import select_figure_formats
from IPython.display import display

from .config import InlineBackend


Expand Down Expand Up @@ -101,9 +100,9 @@ def show(close=None, block=None):


# This flag will be reset by draw_if_interactive when called
show._draw_called = False
show._draw_called = False # type: ignore[attr-defined]
# list of figures to draw when flush_figures is called
show._to_draw = []
show._to_draw = [] # type: ignore[attr-defined]


def flush_figures():
Expand Down
2 changes: 1 addition & 1 deletion matplotlib_inline/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
# Copyright (c) IPython Development Team.
# Distributed under the terms of the BSD 3-Clause License.

from traitlets import Bool, Dict, Instance, Set, TraitError, Unicode
from traitlets.config.configurable import SingletonConfigurable
from traitlets import Dict, Instance, Set, Bool, TraitError, Unicode


# Configurable for inline backend options
Expand Down
Empty file added matplotlib_inline/py.typed
Empty file.
14 changes: 14 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -72,3 +72,17 @@ filterwarnings = ["error"]
testpaths = [
"tests",
]

[tool.mypy]
strict=false
warn_unreachable=true
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]

[tool.ruff]

[tool.ruff.lint]
extend-select = [
"UP", # pyupgrade
"I", # isort
"B", # flake8-bugbear
]