From 89459a334873c1353f13b9d59f8915bb0f6f1876 Mon Sep 17 00:00:00 2001 From: Eoghan O'Connell Date: Thu, 23 Apr 2026 14:36:59 +0200 Subject: [PATCH 1/8] ci: expand matrix to latest versions --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 782440d..c913718 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.10', '3.11'] + python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] os: [macos-latest, ubuntu-latest, windows-latest] env: # Display must be available globally for linux to know where xvfb is From a9ed90e82b7add7dc8ea66bb46f91706b06d28a4 Mon Sep 17 00:00:00 2001 From: Eoghan O'Connell Date: Thu, 23 Apr 2026 15:22:20 +0200 Subject: [PATCH 2/8] setup: support newer matplotlib versions --- .gitignore | 5 ++++- pyjibe/fd/mpl_indent.py | 22 ++++++++++++++++++---- pyjibe/head/__init__.py | 18 +++++++++++++++++- pyproject.toml | 7 ++++--- 4 files changed, 43 insertions(+), 9 deletions(-) diff --git a/.gitignore b/.gitignore index 66fa4da..7a092c7 100644 --- a/.gitignore +++ b/.gitignore @@ -107,4 +107,7 @@ _version_save.py .idea -pyjibe/_version.py \ No newline at end of file +pyjibe/_version.py + +# uv +uv.lock diff --git a/pyjibe/fd/mpl_indent.py b/pyjibe/fd/mpl_indent.py index 77c9a66..5714f4e 100644 --- a/pyjibe/fd/mpl_indent.py +++ b/pyjibe/fd/mpl_indent.py @@ -104,13 +104,27 @@ def update(self, fdist, rescale_x=None, rescale_y=None): self.plots["residuals"].set_data(fdist["tip position"]*xscale, (fdist["fit residuals"])*yscale) # fit range - xy = self.plots["fit range"].get_xy() fitrange = (fdist[xaxis]*xscale)[fdist["fit range"]] fitmin = np.min(fitrange) fitmax = np.max(fitrange) - xy[:, 0] = fitmax - xy[2:4, 0] = fitmin - self.plots["fit range"].set_xy(xy) + fr_patch = self.plots["fit range"] + # Matplotlib changed `Axes.axvspan` from returning a + # Polygon (3.7.x) to returning a Rectangle (>=3.8). + if hasattr(fr_patch, "set_x") and hasattr(fr_patch, "set_width"): + fr_patch.set_x(fitmin) + fr_patch.set_width(fitmax - fitmin) + else: + xy = np.asarray(fr_patch.get_xy(), dtype=float).copy() + if xy.ndim == 2 and xy.shape[1] == 2 and xy.shape[0] >= 4: + # Expected vertex order: + # (xmin,0),(xmin,1),(xmax,1),(xmax,0),... + xy[0, 0] = fitmin + xy[1, 0] = fitmin + xy[2, 0] = fitmax + xy[3, 0] = fitmax + if xy.shape[0] >= 5: + xy[4, 0] = fitmin + fr_patch.set_xy(xy) self.update_plot(rescale_x=rescale_x, rescale_y=rescale_y) diff --git a/pyjibe/head/__init__.py b/pyjibe/head/__init__.py index a709c9b..b9f09a5 100644 --- a/pyjibe/head/__init__.py +++ b/pyjibe/head/__init__.py @@ -1 +1,17 @@ -from .main import PyJibe # noqa: F401 +"""Main application package. + +Keep imports lazy to avoid circular imports when other modules import +`pyjibe.head.*` utilities (e.g. custom widgets) while `pyjibe.head.main` pulls +in the registry. +""" + +from __future__ import annotations + +__all__ = ["PyJibe"] + + +def __getattr__(name: str): + if name == "PyJibe": + from .main import PyJibe + return PyJibe + raise AttributeError(name) diff --git a/pyproject.toml b/pyproject.toml index ccd34c5..c1bb5c8 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,8 +30,9 @@ license = { text = "GPL version 3.0 or later" } dependencies = [ "afmformats>=0.18.6", "nanite>=4.2.3", - # https://github.com/AFM-analysis/PyJibe/issues/32 - "matplotlib>=3,<3.7.5", # NavigationToolbar2QT mod + # Historically pinned due to Matplotlib/toolbar API changes (#32). The + # codebase now supports newer Matplotlib releases again. + "matplotlib>=3,<4", "packaging", # for version checking during update "pyqt6", ] @@ -51,4 +52,4 @@ packages = ["pyjibe"] [tool.setuptools_scm] write_to = "pyjibe/_version.py" -version_scheme = "post-release" \ No newline at end of file +version_scheme = "post-release" From 591aa2f80a1b253bb0a3007d24ad0cfb58cd6829 Mon Sep 17 00:00:00 2001 From: Eoghan O'Connell Date: Thu, 23 Apr 2026 15:23:22 +0200 Subject: [PATCH 3/8] update CHANGELOG --- CHANGELOG | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG b/CHANGELOG index c396111..41eb237 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,3 +1,5 @@ +0.16.4 + - setup: support latest matplotlib versions 0.16.3 - setup: bump afmformats to 0.18.6 - setup: bump nanite to 4.2.3 From 2589786139819eea2fe277d6418dd6babd19b810 Mon Sep 17 00:00:00 2001 From: Eoghan O'Connell Date: Thu, 23 Apr 2026 16:13:01 +0200 Subject: [PATCH 4/8] ci: make coverage use newer core sysmon --- .github/workflows/check.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index c913718..b2b1494 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -55,6 +55,8 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | coverage run --source=pyjibe -m pytest -x tests + env: + COVERAGE_CORE: sysmon # for py>=3.12 this is much faster - name: Lint with flake8 run: | flake8 --exclude _version.py . From 53f46227559bacc8dd45731500716764ca115278 Mon Sep 17 00:00:00 2001 From: Eoghan O'Connell Date: Thu, 23 Apr 2026 16:14:13 +0200 Subject: [PATCH 5/8] ci: make coverage use newer core sysmon, corrently --- .github/workflows/check.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index b2b1494..936fa05 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -53,10 +53,9 @@ jobs: env: # github token required for testing update.py GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + COVERAGE_CORE: sysmon # for py>=3.12 this is much faster run: | coverage run --source=pyjibe -m pytest -x tests - env: - COVERAGE_CORE: sysmon # for py>=3.12 this is much faster - name: Lint with flake8 run: | flake8 --exclude _version.py . From 839dbcb31029bb237d73506338b6de3813d9f8f6 Mon Sep 17 00:00:00 2001 From: Eoghan O'Connell Date: Thu, 23 Apr 2026 16:28:06 +0200 Subject: [PATCH 6/8] ref: remove unneeded changes --- pyjibe/head/__init__.py | 18 +----------------- pyproject.toml | 2 -- 2 files changed, 1 insertion(+), 19 deletions(-) diff --git a/pyjibe/head/__init__.py b/pyjibe/head/__init__.py index b9f09a5..a709c9b 100644 --- a/pyjibe/head/__init__.py +++ b/pyjibe/head/__init__.py @@ -1,17 +1 @@ -"""Main application package. - -Keep imports lazy to avoid circular imports when other modules import -`pyjibe.head.*` utilities (e.g. custom widgets) while `pyjibe.head.main` pulls -in the registry. -""" - -from __future__ import annotations - -__all__ = ["PyJibe"] - - -def __getattr__(name: str): - if name == "PyJibe": - from .main import PyJibe - return PyJibe - raise AttributeError(name) +from .main import PyJibe # noqa: F401 diff --git a/pyproject.toml b/pyproject.toml index c1bb5c8..3e1c471 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -30,8 +30,6 @@ license = { text = "GPL version 3.0 or later" } dependencies = [ "afmformats>=0.18.6", "nanite>=4.2.3", - # Historically pinned due to Matplotlib/toolbar API changes (#32). The - # codebase now supports newer Matplotlib releases again. "matplotlib>=3,<4", "packaging", # for version checking during update "pyqt6", From 499a5877fcfc23cb66a691ad82e88b66cd08d5a4 Mon Sep 17 00:00:00 2001 From: Eoghan O'Connell Date: Thu, 23 Apr 2026 16:28:54 +0200 Subject: [PATCH 7/8] ci: reduce py matrix to three versions --- .github/workflows/check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 936fa05..31df5a6 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -11,7 +11,7 @@ jobs: strategy: fail-fast: false matrix: - python-version: ['3.10', '3.11', '3.12', '3.13', '3.14'] + python-version: ['3.11', '3.12', '3.13'] os: [macos-latest, ubuntu-latest, windows-latest] env: # Display must be available globally for linux to know where xvfb is From 69f01bc710d13d8f26c759ddbe2ddede9233a841 Mon Sep 17 00:00:00 2001 From: Eoghan O'Connell Date: Thu, 23 Apr 2026 16:43:15 +0200 Subject: [PATCH 8/8] update CHANGELOG --- CHANGELOG | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG b/CHANGELOG index 41eb237..26473e3 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -1,5 +1,6 @@ 0.16.4 - - setup: support latest matplotlib versions + - setup: support latest python versions (#32, #46) + - setup: support latest matplotlib versions (#32, #46) 0.16.3 - setup: bump afmformats to 0.18.6 - setup: bump nanite to 4.2.3