unofficial mirror of guix-patches@gnu.org 
 help / color / mirror / code / Atom feed
From: Nicolas Graves via Guix-patches via <guix-patches@gnu.org>
To: 67813@debbugs.gnu.org
Cc: ngraves@ngraves.fr
Subject: [bug#67813] [PATCH 12/12] gnu: python-pandas: Update to 2.1.1.
Date: Wed, 13 Dec 2023 22:56:32 +0100	[thread overview]
Message-ID: <20231213215635.15562-12-ngraves@ngraves.fr> (raw)
In-Reply-To: <20231213215635.15562-1-ngraves@ngraves.fr>

* gnu/packages/python-science.scm (python-pandas): Update to 2.1.1.
[source]: Use git origin.
[build-system]: Use pyproject-build-system.
[arguments]:
  (modules): Remove argument.
  (test-flags): Add required test flags.
  (phases): Add phase version-set-by-guix and pre-check.
  Remove phase enable-parallel-build. Remove check phase
  replacement.
[propagated-inputs]: Add package python-tzdata.
[native-inputs]: Add meson-python, python-versioneer python-matplotlib,
python-openpyxl, python-asyncio, python-pytest-localserver. Replace
python-pytest by python-pytest-next.
---
 gnu/packages/python-science.scm | 132 +++++++++++++++++---------------
 1 file changed, 72 insertions(+), 60 deletions(-)

diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm
index 2e238dc198..09d130537f 100644
--- a/gnu/packages/python-science.scm
+++ b/gnu/packages/python-science.scm
@@ -468,75 +468,81 @@ (define-public python-tspex
 (define-public python-pandas
   (package
     (name "python-pandas")
-    (version "1.4.4")
+    (version "2.1.1")
     (source
      (origin
-       (method url-fetch)
-       (uri (pypi-uri "pandas" version))
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/pandas-dev/pandas")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
        (sha256
-        (base32 "0ryv66s9cvd27q6a985vv556k2qlnlrdna2z7qc7bdhphrrhsv5b"))))
-    (build-system python-build-system)
+        (base32 "1v9j38bvw739csdfl98ga6fqjdm61q3p5a2l7h364kg925nbc9r1"))))
+    (build-system pyproject-build-system)
     (arguments
-     `(#:modules ((guix build utils)
-                  (guix build python-build-system)
-                  (ice-9 ftw)
-                  (srfi srfi-1)
-                  (srfi srfi-26))
-       #:phases
-       (modify-phases %standard-phases
-         (add-after 'unpack 'enable-parallel-build
-           (lambda _
-             (substitute* "setup.py"
-               (("\"-j\", type=int, default=1")
-                (format #f "\"-j\", type=int, default=~a"
-                        (parallel-job-count))))))
-         (add-after 'unpack 'patch-which
-           (lambda* (#:key inputs #:allow-other-keys)
-             (let ((which (assoc-ref inputs "which")))
-               (substitute* "pandas/io/clipboard/__init__.py"
-                 (("^WHICH_CMD = .*")
-                  (string-append "WHICH_CMD = \"" which "\"\n"))))))
-         (add-before 'check 'prepare-x
-           (lambda _
-             (system "Xvfb &")
-             (setenv "DISPLAY" ":0")
-             ;; xsel needs to write a log file.
-             (setenv "HOME" "/tmp")))
-         (replace 'check
-           (lambda* (#:key tests? #:allow-other-keys)
-             (let ((build-directory
-                    (string-append
-                     (getcwd) "/build/"
-                     (first (scandir "build"
-                                     (cut string-prefix? "lib." <>))))))
-               (substitute* "pyproject.toml"
-                 ;; Not all data files are distributed with the tarball.
-                 (("--strict-data-files ") ""))
-               (with-directory-excursion build-directory
-                 (when tests?
-                   (invoke "pytest" "-vv" "pandas" "--skip-slow"
-                           "--skip-network"
-                           "-n" (number->string (parallel-job-count))
-                           "-k"
-                           (string-append
-                            ;; These test access the internet (see:
-                            ;; https://github.com/pandas-dev/pandas/issues/45085).:
-                            ;; pandas/tests/io/xml/test_xml.py::test_wrong_url[lxml]
-                            ;; pandas/tests/io/xml/test_xml.py::test_wrong_url[etree]
-                            "not test_wrong_url"
-                            ;; TODO: Missing input
-                            " and not TestS3"
-                            " and not s3"
-                            ;; This test fails when run with pytest-xdist
-                            ;; (see:
-                            ;; https://github.com/pandas-dev/pandas/issues/39096).
-                            " and not test_memory_usage"))))))))))
+     (list
+      #:test-flags
+      #~(list "--pyargs" "pandas"
+              ;; "--exitfirst"
+              ;; FIXME "-n" (number->string (parallel-job-count))
+              "-m" "not slow and not network and not db"
+              "-k" (string-append
+                    "not test_git_version"
+                    " and not test_show_versions_console"
+                    ;; Not testing ~ expansion.
+                    " and not test_expand_user"
+                    " and not test_get_handle_with_path"
+                    ;; These test access the internet (see:
+                    ;; https://github.com/pandas-dev/pandas/issues/45085).:
+                    ;; pandas/tests/io/xml/test_xml.py::test_wrong_url[lxml]
+                    ;; pandas/tests/io/xml/test_xml.py::test_wrong_url[etree]
+                    " and not test_wrong_url"
+                    ;; TODO: Missing input
+                    " and not TestS3"
+                    " and not s3"
+                    ;; This test fails when run with pytest-xdist
+                    ;; (see: https://github.com/pandas-dev/pandas/issues/39096).
+                    " and not test_memory_usage"
+                    " and not test_parsing_tzlocal_deprecated"))
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'version-set-by-guix
+            (lambda _
+              (with-output-to-file "_version_meson.py"
+                (lambda _
+                  (display
+                   (string-append "__version__ = \""
+                                  #$(package-version this-package)
+                                  "\""))))))
+          (add-before 'check 'prepare-x
+            (lambda _
+              (system "Xvfb &")
+              (setenv "DISPLAY" ":0")
+              (setenv "HOME" ".")))
+          (add-after 'unpack 'patch-which
+            (lambda _
+              (substitute* "pandas/io/clipboard/__init__.py"
+                (("^WHICH_CMD = .*")
+                 (string-append "WHICH_CMD = \""
+                                #$(this-package-input "which")
+                                "/bin/which\"\n")))))
+          ;; The compiled libraries are only in the output at this point,
+          ;; but they are needed to run tests.
+          ;; FIXME: This should be handled by the pyargs pytest argument,
+          ;; but is not for some reason.
+          (add-before 'check 'pre-check
+            (lambda _
+              (copy-recursively
+               (string-append #$output
+                              "/lib/python3.10/site-packages/pandas/_libs")
+               "pandas/_libs"))))))
     (propagated-inputs
      (list python-jinja2
            python-numpy
            python-openpyxl
            python-pytz
            python-dateutil
+           python-tzdata
            python-xlrd
            python-xlsxwriter))
     (inputs
@@ -546,9 +552,15 @@ (define-public python-pandas
            python-beautifulsoup4
            python-lxml
            python-html5lib
-           python-pytest
+           meson-python
+           python-matplotlib
+           python-openpyxl
+           python-pytest-next
+           python-pytest-asyncio
+           python-pytest-localserver
            python-pytest-mock
            python-pytest-xdist
+           python-versioneer
            ;; Needed to test clipboard support.
            xorg-server-for-tests))
     (home-page "https://pandas.pydata.org")
-- 
2.41.0





  parent reply	other threads:[~2023-12-13 21:59 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-12-13 14:39 [bug#67813] [PATCH 00/12] Update python-pandas to version 2.1.1 Nicolas Graves via Guix-patches via
2023-12-13 21:56 ` [bug#67813] [PATCH 01/12] gnu: meson/newer: Update to 1.2.1 Nicolas Graves via Guix-patches via
2023-12-13 21:56   ` [bug#67813] [PATCH 02/12] gnu: meson-python: Update to 0.13.1 Nicolas Graves via Guix-patches via
2023-12-13 21:56   ` [bug#67813] [PATCH 03/12] gnu: python-cython: Update to 0.29.33 Nicolas Graves via Guix-patches via
2023-12-13 21:56   ` [bug#67813] [PATCH 04/12] gnu: python-pyproject-metadata: Update to 0.7.1 Nicolas Graves via Guix-patches via
2023-12-13 21:56   ` [bug#67813] [PATCH 05/12] gnu: Add python-tzdata Nicolas Graves via Guix-patches via
2023-12-13 21:56   ` [bug#67813] [PATCH 06/12] gnu: python-jinja2: Update to 3.1.2 Nicolas Graves via Guix-patches via
2023-12-13 21:56   ` [bug#67813] [PATCH 07/12] gnu: python-pytest-xdist: Use pyproject-build-system Nicolas Graves via Guix-patches via
2023-12-13 21:56   ` [bug#67813] [PATCH 08/12] gnu: python-openpyxl: Update to 3.0.10 Nicolas Graves via Guix-patches via
2023-12-13 21:56   ` [bug#67813] [PATCH 09/12] gnu: Add python-contourpy Nicolas Graves via Guix-patches via
2023-12-13 21:56   ` [bug#67813] [PATCH 10/12] gnu: python-matplotlib: Update to 3.6.3 Nicolas Graves via Guix-patches via
2023-12-13 21:56   ` [bug#67813] [PATCH 11/12] gnu: Add python-pytest-next Nicolas Graves via Guix-patches via
2023-12-13 21:56   ` Nicolas Graves via Guix-patches via [this message]
2024-01-11  9:52 ` [bug#67813] [PATCH 00/12] Update python-pandas to version 2.1.1 Ricardo Wurmus
2024-02-04  2:36   ` Nicolas Graves via Guix-patches via

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20231213215635.15562-12-ngraves@ngraves.fr \
    --to=guix-patches@gnu.org \
    --cc=67813@debbugs.gnu.org \
    --cc=ngraves@ngraves.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/guix.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).