From 5fcf8b1ea7968e74b650e93b32d577ed8c483c96 Mon Sep 17 00:00:00 2001 From: Sharlatan Hellseher Date: Tue, 6 Jan 2026 11:56:30 +0000 Subject: [PATCH] gnu: python-pyreadstat: Update to 1.3.2. * gnu/packages/statistics.scm (python-pyreadstat): Update to 1.3.2. [arguments] : Move custom 'check phase logic here. : Remove 'change-home-dir; add 'pre-check. [inputs]: Add readstat. [propagated-inputs]: Add python-narwhals-minimal and python-numpy. * gnu/packages/patches/python-pyreadstat-link-libiconv.patch: Refresh patch for 1.3.2. Change-Id: I478c67cb48574178483b6dfe97b5ed7bf9b4c783 Signed-off-by: Rutherther --- .../python-pyreadstat-link-libiconv.patch | 7 +-- gnu/packages/statistics.scm | 47 ++++++++++--------- 2 files changed, 29 insertions(+), 25 deletions(-) diff --git a/gnu/packages/patches/python-pyreadstat-link-libiconv.patch b/gnu/packages/patches/python-pyreadstat-link-libiconv.patch index 7efd71faeba52f94bca64eb206fa5434ae119eb5..f1876a1be48e352159f6db78a3ff204332b4a062 100644 --- a/gnu/packages/patches/python-pyreadstat-link-libiconv.patch +++ b/gnu/packages/patches/python-pyreadstat-link-libiconv.patch @@ -2,11 +2,12 @@ To ensure libiconv can be found by Guix, we need to link the library. --- a/setup.py +++ b/setup.py -@@ -81,8 +81,7 @@ else: +@@ -109,9 +109,7 @@ if os.name == 'nt': + else: libraries.extend(["m", "z"]) _platform = sys.platform - # Mac: iconv needs to be linked statically -- if _platform.lower().startswith("darwin"): +- # Mac and ubuntu: iconv needs to be linked statically +- if _platform.lower().startswith("darwin") or (is_ubuntu() and is_python_lt_14()): - libraries.append("iconv") + libraries.append("iconv") diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index 7477224e1559e7a0f2936eaa3b91f663a1b1baf6..0c64e9c64e11f7a5664a64ed5803b3ed81a76ccc 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -3479,42 +3479,45 @@ files, including Rmarkdown files.") (define-public python-pyreadstat (package (name "python-pyreadstat") - (version "1.2.4") + (version "1.3.2") (source (origin (method git-fetch) (uri (git-reference - (url "https://github.com/Roche/pyreadstat") - (commit (string-append "v" version)))) + (url "https://github.com/Roche/pyreadstat") + (commit (string-append "v" version)))) (file-name (git-file-name name version)) (sha256 - (base32 "0zysrzixvqw2lwwykxqg5yj8a0zyv5s2bmk22x30f4rj2hgvq1pv")) + (base32 "01b7zwvfl46sra0kvdvs19ggx150p4x7pkwl73ar2jda315kjfr4")) (patches (search-patches "python-pyreadstat-link-libiconv.patch")))) (build-system pyproject-build-system) (arguments (list + ;; tests: 92 passed + #:test-backend #~'custom + ;; The source also contains tests/test_version.py which checks the + ;; version in __init__.py against the one in setup.py. Since this + ;; requires texlive dependencies to run and is also not mentioned in + ;; how_to_test.md, this test is skipped. + #:test-flags #~(list "tests/test_basic.py") #:phases #~(modify-phases %standard-phases - (add-before 'check 'change-home-dir + (add-before 'check 'pre-check (lambda _ - ;; test_sav_expand and test_sav_write_basic_expanduser need a - ;; home directory with write permissions. - (setenv "HOME" "/tmp"))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - ;; The source also contains tests/test_version.py - ;; which checks the version in __init__.py against the - ;; one in setup.py. Since this requires texlive - ;; dependencies to run and is also not mentioned in - ;; how_to_test.md, this test is skipped. - (invoke "python" "tests/test_basic.py"))))))) - (propagated-inputs (list python-pandas)) - (inputs (list libiconv zlib)) - (native-inputs (list python-cython python-setuptools)) + (setenv "HOME" "/tmp")))))) + (native-inputs + (list python-cython + python-setuptools)) + (inputs + (list libiconv + readstat + zlib)) + (propagated-inputs + (list python-narwhals-minimal + python-pandas + python-numpy)) (home-page "https://github.com/Roche/pyreadstat") - (synopsis - "Read and write SAS, SPSS and Stata files into/from Pandas DataFrames") + (synopsis "Read and write SAS, SPSS and Stata files into/from Pandas DataFrames") (description "This Python package can be used to read and write SAS, SPSS and Stata files into/from Pandas DataFrames. It is a wrapper around the C library