about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/numpy
diff options
context:
space:
mode:
authorAlyssa Ross <hi@alyssa.is>2024-01-20 12:31:50 +0100
committerAlyssa Ross <hi@alyssa.is>2024-01-20 12:32:25 +0100
commitb7baf40e099b4215181fe7b0c63083b12ef2c7fb (patch)
treea6efabd31d05b6d0a36624729e80377bbbfb0149 /nixpkgs/pkgs/development/python-modules/numpy
parent710028664e26e85cb831a869b3da9f6993902255 (diff)
parent0799f514b1cd74878174939df79ac60ca5036673 (diff)
downloadnixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.gz
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.bz2
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.lz
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.xz
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.tar.zst
nixlib-b7baf40e099b4215181fe7b0c63083b12ef2c7fb.zip
Merge branch 'nixos-unstable-small' of https://github.com/NixOS/nixpkgs
Conflicts:
	nixpkgs/pkgs/build-support/rust/build-rust-package/default.nix
Diffstat (limited to 'nixpkgs/pkgs/development/python-modules/numpy')
-rw-r--r--nixpkgs/pkgs/development/python-modules/numpy/0001-BLD-remove-last-usage-of-distutils-in-_core-code_gen.patch71
-rw-r--r--nixpkgs/pkgs/development/python-modules/numpy/default.nix7
2 files changed, 76 insertions, 2 deletions
diff --git a/nixpkgs/pkgs/development/python-modules/numpy/0001-BLD-remove-last-usage-of-distutils-in-_core-code_gen.patch b/nixpkgs/pkgs/development/python-modules/numpy/0001-BLD-remove-last-usage-of-distutils-in-_core-code_gen.patch
new file mode 100644
index 000000000000..b9bc53e0b84d
--- /dev/null
+++ b/nixpkgs/pkgs/development/python-modules/numpy/0001-BLD-remove-last-usage-of-distutils-in-_core-code_gen.patch
@@ -0,0 +1,71 @@
+From 0d0476328a1a2e3dd3e96340bd4ddd04d98c067b Mon Sep 17 00:00:00 2001
+From: Ralf Gommers <ralf.gommers@gmail.com>
+Date: Thu, 26 Oct 2023 16:57:03 +0200
+Subject: [PATCH] BLD: remove last usage of `distutils` in
+ `_core/code_generators/`
+
+---
+ numpy/core/code_generators/genapi.py             | 9 ---------
+ numpy/core/code_generators/generate_numpy_api.py | 7 +------
+ numpy/core/code_generators/generate_ufunc_api.py | 7 +------
+ 3 files changed, 2 insertions(+), 21 deletions(-)
+
+diff --git a/numpy/core/code_generators/genapi.py b/numpy/core/code_generators/genapi.py
+index 2cdaba52d..d9d7862b2 100644
+--- a/numpy/core/code_generators/genapi.py
++++ b/numpy/core/code_generators/genapi.py
+@@ -304,15 +304,6 @@ def find_functions(filename, tag='API'):
+     fo.close()
+     return functions
+ 
+-def should_rebuild(targets, source_files):
+-    from distutils.dep_util import newer_group
+-    for t in targets:
+-        if not os.path.exists(t):
+-            return True
+-    sources = API_FILES + list(source_files) + [__file__]
+-    if newer_group(sources, targets[0], missing='newer'):
+-        return True
+-    return False
+ 
+ def write_file(filename, data):
+     """
+diff --git a/numpy/core/code_generators/generate_numpy_api.py b/numpy/core/code_generators/generate_numpy_api.py
+index ae38c4efc..640bae9e5 100644
+--- a/numpy/core/code_generators/generate_numpy_api.py
++++ b/numpy/core/code_generators/generate_numpy_api.py
+@@ -148,12 +148,7 @@ def generate_api(output_dir, force=False):
+     targets = (h_file, c_file)
+ 
+     sources = numpy_api.multiarray_api
+-
+-    if (not force and not genapi.should_rebuild(targets, [numpy_api.__file__, __file__])):
+-        return targets
+-    else:
+-        do_generate_api(targets, sources)
+-
++    do_generate_api(targets, sources)
+     return targets
+ 
+ def do_generate_api(targets, sources):
+diff --git a/numpy/core/code_generators/generate_ufunc_api.py b/numpy/core/code_generators/generate_ufunc_api.py
+index e03299a52..3734cbd6a 100644
+--- a/numpy/core/code_generators/generate_ufunc_api.py
++++ b/numpy/core/code_generators/generate_ufunc_api.py
+@@ -125,12 +125,7 @@ def generate_api(output_dir, force=False):
+     targets = (h_file, c_file)
+ 
+     sources = ['ufunc_api_order.txt']
+-
+-    if (not force and not genapi.should_rebuild(targets, sources + [__file__])):
+-        return targets
+-    else:
+-        do_generate_api(targets, sources)
+-
++    do_generate_api(targets, sources)
+     return targets
+ 
+ def do_generate_api(targets, sources):
+-- 
+2.42.0
+
diff --git a/nixpkgs/pkgs/development/python-modules/numpy/default.nix b/nixpkgs/pkgs/development/python-modules/numpy/default.nix
index 62ffc91e8767..ff50cf872f9c 100644
--- a/nixpkgs/pkgs/development/python-modules/numpy/default.nix
+++ b/nixpkgs/pkgs/development/python-modules/numpy/default.nix
@@ -53,17 +53,20 @@ let
   };
 in buildPythonPackage rec {
   pname = "numpy";
-  version = "1.26.1";
+  version = "1.26.2";
   pyproject = true;
   disabled = pythonOlder "3.9" || pythonAtLeast "3.13";
 
   src = fetchPypi {
     inherit pname version;
     extension = "tar.gz";
-    hash = "sha256-yMbHLUqfgx8yjvsTEmQqHK+vqoiYHZq3Y2jVDQfZPL4=";
+    hash = "sha256-9lc4RHZ2q1d38R5ru9uM4Rt4XhBfaQvEWWZXSBa20+o=";
   };
 
   patches = [
+    # Remove last usage of distutils to enable numpy on Python 3.12
+    ./0001-BLD-remove-last-usage-of-distutils-in-_core-code_gen.patch
+
     # Disable `numpy/core/tests/test_umath.py::TestComplexFunctions::test_loss_of_precision[complex256]`
     # on x86_64-darwin because it fails under Rosetta 2 due to issues with trig functions and
     # 80-bit long double complex numbers.