Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

python312Packages.pythonqwt: init at 0.12.7 #327446

Merged
merged 3 commits into from
Oct 21, 2024

Conversation

doronbehar
Copy link
Contributor

Description of changes

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@doronbehar doronbehar requested a review from natsukium as a code owner July 15, 2024 18:29
@ofborg ofborg bot added 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 labels Jul 15, 2024
Copy link
Member

@natsukium natsukium left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you format these files with nixfmt-rfc-style?

@doronbehar
Copy link
Contributor Author

Thanks for the review :). Why did you suggest to add setuptools to the build-system? It builds fine without it..

Could you format these files with nixfmt-rfc-style?

Done.

Copy link
Member

@dotlambda dotlambda left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll give you a working shell.nix with packageOverrides in a few days

@dotlambda
Copy link
Member

Why did you suggest to add setuptools to the build-system? It builds fine without it..

That's just accidental cause something propagates it but might stop doing so in the future. Also, cross compilation.

@doronbehar
Copy link
Contributor Author

Why did you suggest to add setuptools to the build-system? It builds fine without it..

That's just accidental cause something propagates it but might stop doing so in the future. Also, cross compilation.

OK that's a good reason, thanks for explaining.

@doronbehar doronbehar force-pushed the pkg/PlotPyStack branch 2 times, most recently from b58a075 to 2e2b411 Compare September 1, 2024 10:18
@doronbehar
Copy link
Contributor Author

Resolved all of the review comments, besides of course the numpy / numpy_2 debate which is still under discussion.

@dotlambda
Copy link
Member

dotlambda commented Sep 1, 2024

Here's what you should do if PlotPy really only supports NumPy 2:

diff --git a/pkgs/by-name/pl/plotpy-test/package.nix b/pkgs/by-name/pl/plotpy-test/package.nix
new file mode 100644
index 000000000000..c07481355fac
--- /dev/null
+++ b/pkgs/by-name/pl/plotpy-test/package.nix
@@ -0,0 +1,12 @@
+{
+  python3,
+}:
+
+let
+  python = python3.override {
+    packageOverrides = self: super: {
+      numpy = self.numpy_2;
+    };
+  };
+in
+python.pkgs.plotpy
diff --git a/pkgs/development/python-modules/guidata/default.nix b/pkgs/development/python-modules/guidata/default.nix
index afa802aab927..5a00f6c32134 100644
--- a/pkgs/development/python-modules/guidata/default.nix
+++ b/pkgs/development/python-modules/guidata/default.nix
@@ -3,7 +3,7 @@
   buildPythonPackage,
   fetchFromGitHub,
   setuptools,
-  numpy_2,
+  numpy,
   qtpy,
   h5py,
   requests,
@@ -32,19 +32,17 @@ buildPythonPackage rec {
   dependencies = [
     qtpy
     h5py
+    numpy
     requests
     tomli
   ];
+
   nativeCheckInputs = [
     pytestCheckHook
     # Not propagating this, to allow one to choose to either choose a pyqt /
     # pyside implementation
     pyqt6
   ];
-  buildInputs = [
-    # Can work with both numpy_2 and numpy_1, so not propagating it.
-    numpy_2
-  ];
 
   preCheck = ''
     export QT_PLUGIN_PATH="${lib.getBin qt6.qtbase}/${qt6.qtbase.qtPluginPrefix}"
diff --git a/pkgs/development/python-modules/plotpy/default.nix b/pkgs/development/python-modules/plotpy/default.nix
index 05e47385f601..7c7ce8f27e8e 100644
--- a/pkgs/development/python-modules/plotpy/default.nix
+++ b/pkgs/development/python-modules/plotpy/default.nix
@@ -3,10 +3,11 @@
   buildPythonPackage,
   fetchFromGitHub,
   cython_0,
-  numpy_2,
+  numpy,
   setuptools,
   guidata,
   pillow,
+  plotpy-test,
   qwt,
   scikit-image,
   scipy,
@@ -32,8 +33,7 @@ buildPythonPackage rec {
 
   dependencies = [
     guidata
-    # Doesn't support numpy_1
-    numpy_2
+    numpy
     pillow
     qwt
     scikit-image
@@ -43,7 +43,13 @@ buildPythonPackage rec {
 
   pythonImportsCheck = [ "plot_py" ];
 
+  passthru.tests = {
+    # builds plotpy in a Python package set with `numpy = numpy_2`
+    inherit plotpy-test;
+  };
+
   meta = {
+    broken = lib.versionOlder numpy.version "2";
     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";
diff --git a/pkgs/development/python-modules/qwt/default.nix b/pkgs/development/python-modules/qwt/default.nix
index ace4905fa570..f3b99c5dfc69 100644
--- a/pkgs/development/python-modules/qwt/default.nix
+++ b/pkgs/development/python-modules/qwt/default.nix
@@ -27,18 +27,16 @@ buildPythonPackage rec {
   ];
 
   dependencies = [
+    numpy
     qtpy
   ];
+
   nativeCheckInputs = [
     pytestCheckHook
     # Not propagating this, to allow one to choose to either choose a pyqt /
     # pyside implementation
     pyqt6
   ];
-  buildInputs = [
-    # Can work with both numpy_2 and numpy_1, so not propagating it.
-    numpy
-  ];
 
   preCheck = ''
     export QT_PLUGIN_PATH="${lib.getBin qt6.qtbase}/${qt6.qtbase.qtPluginPrefix}"

The plotpy-test would make sure that a Python environment using NumPy 2 is built by Hydra.

@doronbehar doronbehar force-pushed the pkg/PlotPyStack branch 2 times, most recently from 9fd16dd to a1b02f6 Compare September 4, 2024 22:29
@doronbehar doronbehar changed the title python312Packages.qwt: init at 0.12.6 python312Packages.pythonqwt: init at 0.12.6 Sep 5, 2024
@nixos-discourse
Copy link

This pull request has been mentioned on NixOS Discourse. There might be relevant details there:

https://discourse.nixos.org/t/several-comments-about-priorities-and-new-policies-in-the-python-ecosystem/51790/1

@doronbehar doronbehar marked this pull request as ready for review September 9, 2024 17:40
@doronbehar
Copy link
Contributor Author

OK I propagated all of numpy's usages, and so the rest of the review comments are resolved. I can live with Numpy 1 in the near future, until better dependencies' conflict resolution will be available.

@doronbehar doronbehar requested a review from dotlambda September 9, 2024 17:43
@doronbehar doronbehar marked this pull request as draft September 10, 2024 18:09
@doronbehar
Copy link
Contributor Author

Converted back to a draft because there are still a few issues that upstream now makes an effort to solve at PlotPyStack/PlotPy#20 .

@doronbehar doronbehar marked this pull request as ready for review October 2, 2024 06:58
@doronbehar doronbehar changed the title python312Packages.pythonqwt: init at 0.12.6 python312Packages.pythonqwt: init at 0.12.7 Oct 2, 2024
@doronbehar
Copy link
Contributor Author

Upstream fixed the issues it had with some of the tests. Now it should be ready :).

@doronbehar
Copy link
Contributor Author

@dotlambda your review is required.

@doronbehar
Copy link
Contributor Author

Friendly ping @dotlambda .

@dotlambda
Copy link
Member

Sorry for the delay!

@dotlambda
Copy link
Member

nixpkgs-review result

Generated using nixpkgs-review.

Command: nixpkgs-review pr 327446


x86_64-linux

✅ 12 packages built:
  • python311Packages.guidata
  • python311Packages.guidata.dist
  • python311Packages.plotpy
  • python311Packages.plotpy.dist
  • python311Packages.pythonqwt
  • python311Packages.pythonqwt.dist
  • python312Packages.guidata
  • python312Packages.guidata.dist
  • python312Packages.plotpy
  • python312Packages.plotpy.dist
  • python312Packages.pythonqwt
  • python312Packages.pythonqwt.dist

aarch64-linux

✅ 12 packages built:
  • python311Packages.guidata
  • python311Packages.guidata.dist
  • python311Packages.plotpy
  • python311Packages.plotpy.dist
  • python311Packages.pythonqwt
  • python311Packages.pythonqwt.dist
  • python312Packages.guidata
  • python312Packages.guidata.dist
  • python312Packages.plotpy
  • python312Packages.plotpy.dist
  • python312Packages.pythonqwt
  • python312Packages.pythonqwt.dist

@dotlambda dotlambda merged commit b4a6d88 into NixOS:master Oct 21, 2024
29 checks passed
@doronbehar doronbehar deleted the pkg/PlotPyStack branch October 30, 2024 06:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: python 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants