Skip to content

Commit 52fb817

Browse files
authored
testing up to 3.14 and 3.14t (#49)
Add mypy, and ruff. Test on windows.
2 parents 1176823 + 488b6fd commit 52fb817

File tree

5 files changed

+41
-16
lines changed

5 files changed

+41
-16
lines changed

‎.github/workflows/main.yml‎

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,12 @@ jobs:
2222
fail-fast: false
2323
matrix:
2424
os: [ubuntu-latest]
25-
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.13t"]
25+
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14", "3.14t"]
26+
include:
27+
#- os: macos-latest
28+
# python-version: "3.14"
29+
- os: windows-latest
30+
python-version: "3.14"
2631

2732
steps:
2833
- name: Checkout
@@ -36,22 +41,29 @@ jobs:
3641
- name: Install package with test dependencies
3742
run: pip install .[test]
3843

39-
- name: Test installation with nbdime
40-
if: ${{matrix.python-version != '3.9'}}
41-
run: pytest -v --nbdime
42-
4344
- name: Test installation without nbdime
44-
if: ${{matrix.python-version == '3.9'}}
4545
run: pytest -v
4646

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

5051
- name: Install ruff
51-
run: mamba install ruff
52+
if: ${{matrix.python-version == '3.14'}}
53+
run: pip install ruff
5254

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

5659
- name: Check formatting with ruff
60+
if: ${{matrix.python-version == '3.14'}}
5761
run: ruff format matplotlib_inline --check
62+
63+
- name: install Mypy
64+
if: ${{matrix.python-version == '3.14'}}
65+
run : pip install mypy matplotlib
66+
67+
- name: run mypy
68+
if: ${{matrix.python-version == '3.14'}}
69+
run: mypy .

‎matplotlib_inline/backend_inline.py‎

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -4,17 +4,16 @@
44
# Distributed under the terms of the BSD 3-Clause License.
55

66
importmatplotlib
7+
fromIPython.core.getipythonimportget_ipython
8+
fromIPython.core.interactiveshellimportInteractiveShell
9+
fromIPython.core.pylabtoolsimportselect_figure_formats
10+
fromIPython.displayimportdisplay
711
frommatplotlibimportcolors
12+
frommatplotlib._pylab_helpersimportGcf
813
frommatplotlib.backendsimportbackend_agg
914
frommatplotlib.backends.backend_aggimportFigureCanvasAgg
10-
frommatplotlib._pylab_helpersimportGcf
1115
frommatplotlib.figureimportFigure
1216

13-
fromIPython.core.interactiveshellimportInteractiveShell
14-
fromIPython.core.getipythonimportget_ipython
15-
fromIPython.core.pylabtoolsimportselect_figure_formats
16-
fromIPython.displayimportdisplay
17-
1817
from .configimportInlineBackend
1918

2019

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

102101

103102
# This flag will be reset by draw_if_interactive when called
104-
show._draw_called=False
103+
show._draw_called=False# type: ignore[attr-defined]
105104
# list of figures to draw when flush_figures is called
106-
show._to_draw= []
105+
show._to_draw= []# type: ignore[attr-defined]
107106

108107

109108
defflush_figures():

‎matplotlib_inline/config.py‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
# Copyright (c) IPython Development Team.
77
# Distributed under the terms of the BSD 3-Clause License.
88

9+
fromtraitletsimportBool, Dict, Instance, Set, TraitError, Unicode
910
fromtraitlets.config.configurableimportSingletonConfigurable
10-
fromtraitletsimportDict, Instance, Set, Bool, TraitError, Unicode
1111

1212

1313
# Configurable for inline backend options

‎matplotlib_inline/py.typed‎

Whitespace-only changes.

‎pyproject.toml‎

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,3 +72,17 @@ filterwarnings = ["error"]
7272
testpaths = [
7373
"tests",
7474
]
75+
76+
[tool.mypy]
77+
strict=false
78+
warn_unreachable=true
79+
enable_error_code = ["ignore-without-code", "redundant-expr", "truthy-bool"]
80+
81+
[tool.ruff]
82+
83+
[tool.ruff.lint]
84+
extend-select = [
85+
"UP", # pyupgrade
86+
"I", # isort
87+
"B", # flake8-bugbear
88+
]

0 commit comments

Comments
(0)