From 565c85576bcac014cabddf1221551998e629fc75 Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 15 Jul 2024 11:54:42 +0300 Subject: [PATCH 1/3] python312Packages.pythonqwt: init at 0.12.7 --- .../python-modules/pythonqwt/default.nix | 60 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 62 insertions(+) create mode 100644 pkgs/development/python-modules/pythonqwt/default.nix diff --git a/pkgs/development/python-modules/pythonqwt/default.nix b/pkgs/development/python-modules/pythonqwt/default.nix new file mode 100644 index 000000000000..1eb3e3e2aedc --- /dev/null +++ b/pkgs/development/python-modules/pythonqwt/default.nix @@ -0,0 +1,60 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + numpy, + qtpy, + + # tests + pyqt6, + qt6, + pytestCheckHook, +}: + +buildPythonPackage rec { + pname = "pythonqwt"; + version = "0.12.7"; + pyproject = true; + + src = fetchFromGitHub { + owner = "PlotPyStack"; + repo = "PythonQwt"; + rev = "refs/tags/v${version}"; + hash = "sha256-Am7XYumq9PAOmT2ZTC+AAE4VM6/yNF11WLXoTFSbDh4="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + qtpy + numpy + ]; + nativeCheckInputs = [ + pytestCheckHook + # Not propagating this, to allow one to choose to either choose a pyqt / + # pyside implementation + pyqt6 + ]; + + preCheck = '' + export QT_PLUGIN_PATH="${lib.getBin qt6.qtbase}/${qt6.qtbase.qtPluginPrefix}" + export QT_QPA_PLATFORM=offscreen + ''; + + pythonImportsCheck = [ "qwt" ]; + + meta = { + description = "Qt plotting widgets for Python (pure Python reimplementation of Qwt C++ library)"; + homepage = "https://github.com/PlotPyStack/PythonQwt"; + changelog = "https://github.com/PlotPyStack/PythonQwt/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.lgpl21Only; + maintainers = with lib.maintainers; [ doronbehar ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 32b58b06c195..2e8daa5361b8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -13320,6 +13320,8 @@ self: super: with self; { qmk-dotty-dict = callPackage ../development/python-modules/qmk-dotty-dict { }; + pythonqwt = callPackage ../development/python-modules/pythonqwt { }; + r2pipe = callPackage ../development/python-modules/r2pipe { }; rachiopy = callPackage ../development/python-modules/rachiopy { }; From fbfa8e21e6e5600ed6f4ebec2bfdabd5321cd5db Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Mon, 15 Jul 2024 11:48:18 +0300 Subject: [PATCH 2/3] python312Packages.guidata: init at 3.6.3 --- .../python-modules/guidata/default.nix | 96 +++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 98 insertions(+) create mode 100644 pkgs/development/python-modules/guidata/default.nix diff --git a/pkgs/development/python-modules/guidata/default.nix b/pkgs/development/python-modules/guidata/default.nix new file mode 100644 index 000000000000..5ff6a5f37243 --- /dev/null +++ b/pkgs/development/python-modules/guidata/default.nix @@ -0,0 +1,96 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + setuptools, + + # dependencies + numpy, + qtpy, + h5py, + requests, + tomli, + + # tests + pytestCheckHook, + qt6, + pyqt6, + + # passthru.tests + guidata, + pyside6, + qt5, + pyqt5, + pyside2, +}: + +buildPythonPackage rec { + pname = "guidata"; + version = "3.6.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "PlotPyStack"; + repo = "guidata"; + rev = "refs/tags/v${version}"; + hash = "sha256-KfeA6XNbzHZM4dyvAYlPOQIwWHwFT3Akj34zmgf8tb8="; + }; + + build-system = [ + setuptools + ]; + + dependencies = [ + numpy + qtpy + h5py + requests + tomli + ]; + + nativeCheckInputs = [ + pytestCheckHook + # Not propagating this, to allow one to choose to choose a pyqt / pyside + # implementation. + pyqt6 + ]; + + preCheck = '' + export QT_PLUGIN_PATH="${lib.getBin qt6.qtbase}/${qt6.qtbase.qtPluginPrefix}" + export QT_QPA_PLATFORM=offscreen + ''; + + pythonImportsCheck = [ "guidata" ]; + + passthru = { + tests = { + # Should be compatible with all of these Qt implementations + withPyQt6 = guidata.override { + pyqt6 = pyqt6; + qt6 = qt6; + }; + withPySide6 = guidata.override { + pyqt6 = pyside6; + qt6 = qt6; + }; + withPyQt5 = guidata.override { + pyqt6 = pyqt5; + qt6 = qt5; + }; + withPySide2 = guidata.override { + pyqt6 = pyside2; + qt6 = qt5; + }; + }; + }; + + meta = { + description = "Python library generating graphical user interfaces for easy dataset editing and display"; + homepage = "https://github.com/PlotPyStack/guidata"; + changelog = "https://github.com/PlotPyStack/guidata/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ doronbehar ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2e8daa5361b8..edd0f1ca7aab 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5486,6 +5486,8 @@ self: super: with self; { guidance = callPackage ../development/python-modules/guidance { }; + guidata = callPackage ../development/python-modules/guidata { }; + gumath = callPackage ../development/python-modules/gumath { }; gunicorn = callPackage ../development/python-modules/gunicorn { }; From 97fb6ff0a6572b4ca9ca926565310cc74197c1eb Mon Sep 17 00:00:00 2001 From: Doron Behar Date: Sun, 1 Sep 2024 09:46:53 +0300 Subject: [PATCH 3/3] python312Packages.plotpy: init at 2.6.3 --- .../python-modules/plotpy/default.nix | 117 ++++++++++++++++++ pkgs/top-level/python-packages.nix | 2 + 2 files changed, 119 insertions(+) create mode 100644 pkgs/development/python-modules/plotpy/default.nix diff --git a/pkgs/development/python-modules/plotpy/default.nix b/pkgs/development/python-modules/plotpy/default.nix new file mode 100644 index 000000000000..081a9bc25f95 --- /dev/null +++ b/pkgs/development/python-modules/plotpy/default.nix @@ -0,0 +1,117 @@ +{ + lib, + buildPythonPackage, + fetchFromGitHub, + + # build-system + cython_0, + setuptools, + + # dependencies + guidata, + numpy, + pillow, + pythonqwt, + scikit-image, + scipy, + tifffile, + + # tests + pytestCheckHook, + qt6, + pyqt6, + + # passthru.tests + plotpy, + pyside6, + qt5, + pyqt5, + pyside2, +}: + +buildPythonPackage rec { + pname = "plotpy"; + version = "2.6.3"; + pyproject = true; + + src = fetchFromGitHub { + owner = "PlotPyStack"; + repo = "PlotPy"; + rev = "refs/tags/v${version}"; + hash = "sha256-kMVq8X6XP18B5x35BTuC7Q5uFFwds1JxCaxlDuD/UfE="; + }; + + build-system = [ + cython_0 + setuptools + ]; + # Both numpy versions are supported, see: + # https://github.com/PlotPyStack/PlotPy/blob/v2.6.2/pyproject.toml#L8-L9 + postConfigure = '' + substituteInPlace pyproject.toml \ + --replace-fail 'numpy >= 2.0.0' numpy + ''; + + dependencies = [ + guidata + numpy + pillow + pythonqwt + scikit-image + scipy + tifffile + ]; + + nativeCheckInputs = [ + pytestCheckHook + # Not propagating this, to allow one to choose to choose a pyqt / pyside + # implementation. + pyqt6 + ]; + + preCheck = '' + export QT_PLUGIN_PATH="${lib.getBin qt6.qtbase}/${qt6.qtbase.qtPluginPrefix}" + export QT_QPA_PLATFORM=offscreen + # https://github.com/NixOS/nixpkgs/issues/255262 + cd $out + ''; + + pythonImportsCheck = [ + "plotpy" + "plotpy.tests" + ]; + + passthru = { + tests = { + # Upstream doesn't officially supports all of them, although they use + # qtpy, see: https://github.com/PlotPyStack/PlotPy/issues/20 . When this + # package was created, all worked besides withPySide2, with which there + # was a peculiar segmentation fault during the tests. In anycase, PySide2 + # shouldn't be used for modern applications. + withPyQt6 = plotpy.override { + pyqt6 = pyqt6; + qt6 = qt6; + }; + withPySide6 = plotpy.override { + pyqt6 = pyside6; + qt6 = qt6; + }; + withPyQt5 = plotpy.override { + pyqt6 = pyqt5; + qt6 = qt5; + }; + withPySide2 = plotpy.override { + pyqt6 = pyside2; + qt6 = qt5; + }; + }; + }; + + meta = { + description = "Curve and image plotting tools for Python/Qt applications"; + homepage = "https://github.com/PlotPyStack/PlotPy"; + changelog = "https://github.com/PlotPyStack/PlotPy/blob/${src.rev}/CHANGELOG.md"; + license = lib.licenses.bsd3; + maintainers = with lib.maintainers; [ doronbehar ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index edd0f1ca7aab..1aa9e781b6df 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -10459,6 +10459,8 @@ self: super: with self; { plotly = callPackage ../development/python-modules/plotly { }; + plotpy = callPackage ../development/python-modules/plotpy { }; + plotnine = callPackage ../development/python-modules/plotnine { }; pluggy = callPackage ../development/python-modules/pluggy { };