From ff2d0ecfca87450c82df8d74666261b1c19cbe66 Mon Sep 17 00:00:00 2001 From: Nicolas Graves Date: Wed, 13 Dec 2023 22:56:32 +0100 Subject: gnu: Add python-pandas-2. * gnu/packages/python-science.scm (python-pandas-2): New variable. Co-authored-by: Ricardo Wurmus Change-Id: I7f0510f9021d4eac3c981e5e58f73dc3ec7efd2f --- gnu/packages/python-science.scm | 109 ++++++++++++++++++++++++++++++++++++++++ 1 file changed, 109 insertions(+) diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm index 74b5bc7eb2..ba3a8dbb4c 100644 --- a/gnu/packages/python-science.scm +++ b/gnu/packages/python-science.scm @@ -717,6 +717,115 @@ and intuitive. It aims to be the fundamental high-level building block for doing practical, real world data analysis in Python.") (license license:bsd-3))) +(define-public python-pandas-2 + (package + (name "python-pandas") + (version "2.1.1") + (source + (origin + (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 "1v9j38bvw739csdfl98ga6fqjdm61q3p5a2l7h364kg925nbc9r1")))) + (build-system pyproject-build-system) + (arguments + (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-dateutil + python-jinja2 + python-matplotlib + python-numpy + python-openpyxl + python-pytz + python-tzdata + python-xlrd + python-xlsxwriter)) + (inputs + (list which xclip xsel)) + (native-inputs + (list meson-python/newer + python-beautifulsoup4 + python-cython-0.29.35 + python-html5lib + python-lxml + python-matplotlib + python-openpyxl + python-pytest-asyncio + python-pytest-next + 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") + (synopsis "Data structures for data analysis, time series, and statistics") + (description + "Pandas is a Python package providing fast, flexible, and expressive data +structures designed to make working with structured (tabular, +multidimensional, potentially heterogeneous) and time series data both easy +and intuitive. It aims to be the fundamental high-level building block for +doing practical, real world data analysis in Python.") + (license license:bsd-3))) + (define-public python-pandas-stubs (package (name "python-pandas-stubs") -- cgit v1.2.3