[PATCH] gnu: Add NumPy 2 related variants.

  • Open
  • quality assurance status badge
Details
2 participants
  • Ludovic Courtès
  • Sharlatan Hellseher
Owner
unassigned
Submitted by
Sharlatan Hellseher
Severity
normal

Debbugs page

Sharlatan Hellseher wrote 4 weeks ago
(address . guix-patches@gnu.org)(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
e2de75ba2392dbb0aa6021befea7d9a6b8c17959.1739393772.git.sharlatanus@gmail.com
This to make Pandas, MatplotLib and SciPy compatible with NumPy 2. They
need to be build with newer version otherwise it raise the error.

* gnu/packages/python-science.scm: (python-pandas-with-numpy-2,
python-scipy-with-numpy-2): New variables.

* gnu/packages/python-xyz.scm (python-matplotlib-with-numpy-2): New variable.

Change-Id: I53878b643ea6f7b35e3d893a18da438c2c111c52
---
gnu/packages/python-science.scm | 19 +++++++++++++++++++
gnu/packages/python-xyz.scm | 21 +++++++++++++++++++++
2 files changed, 40 insertions(+)

Toggle diff (77 lines)
diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 1f4cdb239a1..0332546d22d 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -475,6 +475,14 @@ (define-public python-scipy
routines such as routines for numerical integration and optimization.")
(license license:bsd-3)))
+(define-public python-scipy-with-numpy-2
+ (package
+ (inherit python-scipy)
+ (propagated-inputs
+ (modify-inputs (package-propagated-inputs python-scipy)
+ (replace "python-numpy" python-numpy-2)
+ (replace "python-matplotlib" python-matplotlib-with-numpy-2)))))
+
(define-public python-scikit-allel
(package
(name "python-scikit-allel")
@@ -1479,6 +1487,17 @@ (define-public python-pandas-2
(define-public python-pandas python-pandas-2)
+(define-public python-pandas-with-numpy-2
+ (package
+ (inherit python-pandas)
+ (native-inputs
+ (modify-inputs (package-native-inputs python-pandas)
+ (replace "python-numpy" python-numpy-2)
+ (replace "python-matplotlib" python-matplotlib-with-numpy-2)))
+ (propagated-inputs
+ (modify-inputs (package-propagated-inputs python-pandas)
+ (replace "python-matplotlib" python-matplotlib-with-numpy-2)))))
+
(define-public python-pandas-stubs
(package
(name "python-pandas-stubs")
diff --git a/gnu/packages/python-xyz.scm b/gnu/packages/python-xyz.scm
index a4017fffe48..1fc6ebdb0b4 100644
--- a/gnu/packages/python-xyz.scm
+++ b/gnu/packages/python-xyz.scm
@@ -10462,6 +10462,27 @@ (define-public python-matplotlib
toolkits.")
(license license:psfl)))
+(define-public python-matplotlib-with-numpy-2
+ (package
+ (inherit python-matplotlib)
+ (version "3.8.4")
+ (source
+ (origin
+ (method url-fetch)
+ (uri (pypi-uri "matplotlib" version))
+ (sha256
+ (base32 "1spzglb3hh3959z72iwspm9dsbf5zz2q3hri1sb5ihcybrykkb4a"))))
+ (arguments
+ (substitute-keyword-arguments
+ (package-arguments python-matplotlib)
+ ((#:tests? _ #t) #f)
+ ((#:phases phases #~%standard-phases)
+ #~(modify-phases #$phases
+ (delete 'sanity-check)))))
+ (propagated-inputs
+ (modify-inputs (package-propagated-inputs python-matplotlib)
+ (replace "python-numpy" python-numpy-2)))))
+
(define-public python-matplotlib-documentation
(package
(inherit python-matplotlib)

base-commit: c9abfacd9f58f7365668b67a8125640b7497932a
prerequisite-patch-id: a2254ccef49d23b75149b22b200b6156097b673f
prerequisite-patch-id: 4e4a0833f7c017f2922344883800161335290814
prerequisite-patch-id: 97653359db283a3832359fc4cd0dc1741a2f51bc
prerequisite-patch-id: 2eac1b43f9e9050e8467c89cd384da43bff63305
--
2.47.1
Ludovic Courtès wrote 4 weeks ago
(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
878qq8znp8.fsf@gnu.org
Hi!

Sharlatan Hellseher <sharlatanus@gmail.com> skribis:

Toggle quote (10 lines)
> This to make Pandas, MatplotLib and SciPy compatible with NumPy 2. They
> need to be build with newer version otherwise it raise the error.
>
> * gnu/packages/python-science.scm: (python-pandas-with-numpy-2,
> python-scipy-with-numpy-2): New variables.
>
> * gnu/packages/python-xyz.scm (python-matplotlib-with-numpy-2): New variable.
>
> Change-Id: I53878b643ea6f7b35e3d893a18da438c2c111c52

[...]

Toggle quote (5 lines)
> +(define-public python-scipy-with-numpy-2
> + (package
> + (inherit python-scipy)
> + (propagated-inputs

Comment for all of these: it should be ‘package/inherit’ (to potentially
inherit replacements) and also change the ‘name’ field to distinguish
it.

Actually, assuming we want to move to NumPy 2.x going forward, I would
suggest keeping the regular name for the -with-numpy-2 variants (like
“python-scipy”) and choose a different name for the NumPy 1.x variants
(like “python-scipy-with-numpy-1”).

That way, somebody running:

guix shell python python-numpy python-scipy

will still get a consistent package set.

How does that sound?

Thanks,
Ludo’.
Ludovic Courtès wrote 3 weeks ago
(name . Sharlatan Hellseher)(address . sharlatanus@gmail.com)
87msef8rod.fsf@gnu.org
Hey Oleg,

Ludovic Courtès <ludo@gnu.org> skribis:

Toggle quote (32 lines)
> Sharlatan Hellseher <sharlatanus@gmail.com> skribis:
>
>> This to make Pandas, MatplotLib and SciPy compatible with NumPy 2. They
>> need to be build with newer version otherwise it raise the error.
>>
>> * gnu/packages/python-science.scm: (python-pandas-with-numpy-2,
>> python-scipy-with-numpy-2): New variables.
>>
>> * gnu/packages/python-xyz.scm (python-matplotlib-with-numpy-2): New variable.
>>
>> Change-Id: I53878b643ea6f7b35e3d893a18da438c2c111c52
>
> [...]
>
>> +(define-public python-scipy-with-numpy-2
>> + (package
>> + (inherit python-scipy)
>> + (propagated-inputs
>
> Comment for all of these: it should be ‘package/inherit’ (to potentially
> inherit replacements) and also change the ‘name’ field to distinguish
> it.
>
> Actually, assuming we want to move to NumPy 2.x going forward, I would
> suggest keeping the regular name for the -with-numpy-2 variants (like
> “python-scipy”) and choose a different name for the NumPy 1.x variants
> (like “python-scipy-with-numpy-1”).
>
> That way, somebody running:
>
> guix shell python python-numpy python-scipy

This broke ‘tests/guix-pack-relocatable.sh’ for these reasons:

Toggle snippet (9 lines)
+ guix pack -RR python-numpy python-scipy --no-grafts -n
guix pack: error: profile contains conflicting entries for python-numpy
guix pack: error: first entry: python-numpy@2.2.2 /gnu/store/i1g6wbcc0ilhcc5vy4pi70z58gk1716f-python-numpy-2.2.2R
guix pack: error: second entry: python-numpy@1.24.4 /gnu/store/2s1jala0jg56drh4hc19mrdg6w3gswhm-python-numpy-1.24.4R
guix pack: error: ... propagated from python-pythran@0.17.0
guix pack: error: ... propagated from python-scipy@1.12.0
hint: Backtrace:

Would be nice to address it before we get a deluge of angry bug reports.
:-)

Ludo’.
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 76240@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 76240
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch
You may also tag this issue. See list of standard tags. For example, to set the confirmed and easy tags
mumi command -t +confirmed -t +easy
Or, remove the moreinfo tag and set the help tag
mumi command -t -moreinfo -t +help