From 2d5b2060e366f38c1e7cc03e039bf42cf7310b00 Mon Sep 17 00:00:00 2001
From: Ricardo Wurmus <rekado@elephly.net>
Date: Thu, 27 Feb 2025 09:19:29 +0100
Subject: gnu: python-vaex-core: Use pyproject-build-system and Pydantic 2.

* gnu/packages/python-science.scm (python-vaex-core)[build-system]: Use
pyproject-build-system.
[arguments]: Remove custom 'check phase; add phase 'patch-for-pydantic.
[propagated-inputs]: Replace python-pydantic with python-pydantic-2; add
python-pydantic-settings.
[native-inputs]: Add python-setuptools and python-wheel.

Change-Id: I0e3d4d30940f55e234a5971431dc1c3fec2abce3
---
 gnu/packages/python-science.scm | 23 +++++++++++++----------
 1 file changed, 13 insertions(+), 10 deletions(-)

(limited to 'gnu/packages/python-science.scm')

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 18d7ce22f7..481d3fc171 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -3936,15 +3936,17 @@ (define-public python-vaex-core
                    (list "vendor/boost"
                          "vendor/pcre"
                          "vendor/pybind11")))))
-    (build-system python-build-system)
+    (build-system pyproject-build-system)
     (arguments
-     `(#:tests? #false ;require vaex.server and others, which require vaex-core.
-       #:phases
-       (modify-phases %standard-phases
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (when tests?
-               (invoke "pytest" "-vv" )))))))
+     (list
+      #:tests? #false ;require vaex.server and others, which require vaex-core.
+      #:phases
+      '(modify-phases %standard-phases
+         (add-after 'unpack 'patch-for-pydantic
+           (lambda _
+             (substitute* "vaex/settings.py"
+               (("from pydantic import BaseModel")
+                "from pydantic_settings import BaseModel")))))))
     (inputs
      (list boost pcre pybind11-2.3))
     (propagated-inputs
@@ -3961,14 +3963,15 @@ (define-public python-vaex-core
            python-pandas
            python-progressbar2
            python-pyarrow
-           python-pydantic
+           python-pydantic-2
+           python-pydantic-settings
            python-pyyaml
            python-requests
            python-rich
            python-six
            python-tabulate))
     (native-inputs
-     (list python-pytest python-cython))
+     (list python-pytest python-cython python-setuptools python-wheel))
     (home-page "https://www.github.com/maartenbreddels/vaex")
     (synopsis "Core of Vaex library for exploring tabular datasets")
     (description "Vaex is a high performance Python library for lazy
-- 
cgit v1.2.3