From e9e76773efa9d6818b97978bfe8d3bd25c51920f Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 12 Apr 2022 18:33:08 +0300 Subject: [PATCH 1/2] napari: fix after the transition to pyproject.toml --- .../python-modules/magicgui/default.nix | 11 +++- .../python-modules/napari-npe2/default.nix | 54 +++++++++++++++++++ .../python-modules/napari/default.nix | 17 ++++-- pkgs/top-level/python-packages.nix | 2 + 4 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 pkgs/development/python-modules/napari-npe2/default.nix diff --git a/pkgs/development/python-modules/magicgui/default.nix b/pkgs/development/python-modules/magicgui/default.nix index 28fa4c9c4e2a..e437ee7290b2 100644 --- a/pkgs/development/python-modules/magicgui/default.nix +++ b/pkgs/development/python-modules/magicgui/default.nix @@ -9,20 +9,29 @@ , pyside2 , psygnal , docstring-parser +, napari # a reverse-dependency, for tests }: buildPythonPackage rec { pname = "magicgui"; version = "0.3.7"; + + format = "pyproject"; + src = fetchFromGitHub { owner = "napari"; repo = "magicgui"; rev = "v${version}"; sha256 = "sha256-LYXNNr5lS3ibQk2NIopZkB8kzC7j3yY8moGMk0Gr+hU="; }; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + nativeBuildInputs = [ setuptools-scm ]; propagatedBuildInputs = [ typing-extensions qtpy pyside2 psygnal docstring-parser ]; checkInputs = [ pytestCheckHook pytest-mypy-plugins ]; + doCheck = false; # Reports "Fatal Python error" - SETUPTOOLS_SCM_PRETEND_VERSION = version; + + passthru.tests = { inherit napari; }; meta = with lib; { description = "Build GUIs from python functions, using magic. (napari/magicgui)"; diff --git a/pkgs/development/python-modules/napari-npe2/default.nix b/pkgs/development/python-modules/napari-npe2/default.nix new file mode 100644 index 000000000000..0fd2c3e5e979 --- /dev/null +++ b/pkgs/development/python-modules/napari-npe2/default.nix @@ -0,0 +1,54 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, appdirs +, pyyaml +, pytomlpp +, pydantic +, magicgui +, typer +, setuptools-scm +, napari # reverse dependency, for tests +}: + +let + pname = "napari-npe2"; + version = "0.3.0"; +in +buildPythonPackage { + inherit pname version; + + format = "pyproject"; + + src = fetchFromGitHub { + owner = "napari"; + repo = "npe2"; + rev = "v${version}"; + hash = "sha256-IyDUeztWQ8JWXDo//76iHzAlWWaZP6/0lwCh0eZAZsM="; + }; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + # npe2 *can* build without it, + # but then setuptools refuses to acknowledge it when building napari + setuptools-scm + ]; + propagatedBuildInputs = [ + appdirs + pyyaml + pytomlpp + pydantic + magicgui + typer + ]; + + passthru.tests = { inherit napari; }; + + meta = with lib; { + description = "Yet another plugin system for napari (the image visualizer)"; + homepage = "https://github.com/napari/npe2"; + license = licenses.bsd3; + maintainers = with maintainers; [ SomeoneSerge ]; + }; +} diff --git a/pkgs/development/python-modules/napari/default.nix b/pkgs/development/python-modules/napari/default.nix index babdbc4506dc..f7d5b24c19e5 100644 --- a/pkgs/development/python-modules/napari/default.nix +++ b/pkgs/development/python-modules/napari/default.nix @@ -6,7 +6,7 @@ , superqt , typing-extensions , tifffile -, napari-plugin-engine +, napari-npe2 , pint , pyyaml , numpydoc @@ -29,15 +29,24 @@ }: mkDerivationWith buildPythonPackage rec { pname = "napari"; version = "0.4.14"; + + format = "pyproject"; + src = fetchFromGitHub { owner = "napari"; repo = pname; rev = "v${version}"; sha256 = "sha256-uDDj5dzsT4tRVV0Y+CYegiCpLM77XFaXEXEZXTnX808="; }; - nativeBuildInputs = [ setuptools-scm wrapQtAppsHook ]; + + SETUPTOOLS_SCM_PRETEND_VERSION = version; + + nativeBuildInputs = [ + setuptools-scm + wrapQtAppsHook + ]; propagatedBuildInputs = [ - napari-plugin-engine + napari-npe2 cachey napari-svg napari-console @@ -60,7 +69,7 @@ jsonschema scipy ]; - SETUPTOOLS_SCM_PRETEND_VERSION = version; + dontUseSetuptoolsCheck = true; postFixup = '' wrapQtApp $out/bin/napari diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 5aaf35c45a45..7f29b76457d6 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -5429,6 +5429,8 @@ in { napari-console = callPackage ../development/python-modules/napari-console { }; + napari-npe2 = callPackage ../development/python-modules/napari-npe2 { }; + napari-plugin-engine = callPackage ../development/python-modules/napari-plugin-engine { }; napari-svg = callPackage ../development/python-modules/napari-svg { }; From a47871ffc46c5e255ddc2c97e8ad3baa06fea72a Mon Sep 17 00:00:00 2001 From: Someone Serge Date: Tue, 12 Apr 2022 18:46:37 +0300 Subject: [PATCH 2/2] shibokeh2: mark as broken for python 3.10 --- pkgs/development/python-modules/shiboken2/default.nix | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkgs/development/python-modules/shiboken2/default.nix b/pkgs/development/python-modules/shiboken2/default.nix index 11461a9545cd..2a7e7613dfb8 100644 --- a/pkgs/development/python-modules/shiboken2/default.nix +++ b/pkgs/development/python-modules/shiboken2/default.nix @@ -34,6 +34,6 @@ stdenv.mkDerivation { license = with licenses; [ gpl2 lgpl21 ]; homepage = "https://wiki.qt.io/Qt_for_Python"; maintainers = with maintainers; [ gebner ]; - broken = stdenv.isDarwin; + broken = stdenv.isDarwin || python.isPy310; }; }