From c152cd1652ca13f074a22809ae9e5224f9373316 Mon Sep 17 00:00:00 2001 From: Pierre Raybaut Date: Thu, 20 Jun 2024 09:28:39 +0200 Subject: [PATCH] Checked compatibility with NumPy V2 --- CHANGELOG.md | 5 +++++ pyproject.toml | 4 ++-- qwt/__init__.py | 2 +- qwt/symbol.py | 1 - qwt/tests/test_errorbar.py | 2 +- qwt/tests/utils.py | 5 ++++- 6 files changed, 13 insertions(+), 6 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4a0ffe..2624550 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,10 @@ # PythonQwt Releases +## Version 0.12.5 + +- Successfully tested with Python 3.12 and NumPy 2.0: requirements have been updated + to remove the NumPy version upper bound constraint. + ## Version 0.12.4 - Fixed segmentation fault issue reported in the `PlotPy` project: diff --git a/pyproject.toml b/pyproject.toml index 24cd52c..438c11e 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -31,7 +31,7 @@ classifiers = [ "Programming Language :: Python :: 3.12", ] requires-python = ">=3.8, <4" -dependencies = ["NumPy>=1.21,<2", "QtPy>=1.9"] +dependencies = ["NumPy>=1.21", "QtPy>=1.9"] dynamic = ["version"] [project.urls] @@ -63,7 +63,7 @@ target-version = "py38" # Assume Python 3.8 [tool.ruff.lint] # all rules can be found here: https://beta.ruff.rs/docs/rules/ -select = ["E", "F", "W", "I"] +select = ["E", "F", "W", "I", "NPY201"] ignore = [ "E203", # space before : (needed for how black formats slicing) ] diff --git a/qwt/__init__.py b/qwt/__init__.py index 8e8fbf3..6ec588b 100644 --- a/qwt/__init__.py +++ b/qwt/__init__.py @@ -55,7 +55,7 @@ from qwt.text import QwtText # noqa: F401 from qwt.toqimage import array_to_qimage as toQImage # noqa: F401 -__version__ = "0.12.4" +__version__ = "0.12.5" QWT_VERSION_STR = "6.1.5" diff --git a/qwt/symbol.py b/qwt/symbol.py index b96377b..a1cbb8e 100644 --- a/qwt/symbol.py +++ b/qwt/symbol.py @@ -19,7 +19,6 @@ from qtpy.QtGui import ( QBrush, QPainter, - QPainterPath, QPen, QPixmap, QPolygonF, diff --git a/qwt/tests/test_errorbar.py b/qwt/tests/test_errorbar.py index b2b303f..55f2fcc 100644 --- a/qwt/tests/test_errorbar.py +++ b/qwt/tests/test_errorbar.py @@ -255,7 +255,7 @@ def drawSeries(self, painter, xMap, yMap, canvasRect, first, last=-1): # draw the caps if self.errorCap > 0: cap = self.errorCap / 2 - n, i, j = len(x), 0, 0 + n, i, _j = len(x), 0, 0 lines = [] while i < n: xi = xMap.transform(x[i]) diff --git a/qwt/tests/utils.py b/qwt/tests/utils.py index 6400cca..7f92a99 100644 --- a/qwt/tests/utils.py +++ b/qwt/tests/utils.py @@ -162,7 +162,10 @@ def fill_layout(self): all_act.triggered.connect(lambda checked: run_all_tests(wait=False)) folder_act = QW.QAction(self.get_std_icon("DirOpenIcon"), "", self) folder_act.setIconText("Open tests folder") - open_test_folder = lambda checked: os.startfile(TEST_PATH) + + def open_test_folder(checked): + return os.startfile(TEST_PATH) + folder_act.triggered.connect(open_test_folder) about_act = QW.QAction(self.get_std_icon("FileDialogInfoView"), "", self) about_act.setIconText("About")