gnu: python-pyreadstat: Switch to pyproject.

* gnu/packages/statistics.scm (python-pyreadstat):
[build-system]: Switch to pyproject-build-system.
[arguments]<#:phases>: Improve style, migrate to gexps.
[native-inputs]: Add python-setuptools.

Change-Id: I56e8dcd877b7b6e688b9d0004fe74b220777df18
Signed-off-by: Sharlatan Hellseher <sharlatanus@gmail.com>
This commit is contained in:
Nicolas Graves 2025-12-29 09:32:10 +01:00 committed by Sharlatan Hellseher
parent f0a4086fad
commit 1664f8c899
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -3356,7 +3356,6 @@ files, including Rmarkdown files.")
(package (package
(name "python-pyreadstat") (name "python-pyreadstat")
(version "1.2.4") (version "1.2.4")
;; No tests in the PyPI tarball.
(source (source
(origin (origin
(method git-fetch) (method git-fetch)
@ -3367,26 +3366,28 @@ files, including Rmarkdown files.")
(sha256 (sha256
(base32 "0zysrzixvqw2lwwykxqg5yj8a0zyv5s2bmk22x30f4rj2hgvq1pv")) (base32 "0zysrzixvqw2lwwykxqg5yj8a0zyv5s2bmk22x30f4rj2hgvq1pv"))
(patches (search-patches "python-pyreadstat-link-libiconv.patch")))) (patches (search-patches "python-pyreadstat-link-libiconv.patch"))))
(build-system pyproject-build-system)
(arguments (arguments
'(#:phases (modify-phases %standard-phases (list
(add-before 'check 'change-home-dir #:phases
(lambda _ #~(modify-phases %standard-phases
;; test_sav_expand and test_sav_write_basic_expanduser need a (add-before 'check 'change-home-dir
;; home directory with write permissions. (lambda _
(setenv "HOME" "/tmp"))) ;; test_sav_expand and test_sav_write_basic_expanduser need a
(replace 'check ;; home directory with write permissions.
(lambda* (#:key tests? #:allow-other-keys) (setenv "HOME" "/tmp")))
(when tests? (replace 'check
;; The source also contains tests/test_version.py (lambda* (#:key tests? #:allow-other-keys)
;; which checks the version in __init__.py against the (when tests?
;; one in setup.py. Since this requires texlive ;; The source also contains tests/test_version.py
;; dependencies to run and is also not mentioned in ;; which checks the version in __init__.py against the
;; how_to_test.md, this test is skipped. ;; one in setup.py. Since this requires texlive
(invoke "python" "tests/test_basic.py"))))))) ;; dependencies to run and is also not mentioned in
(build-system python-build-system) ;; how_to_test.md, this test is skipped.
(invoke "python" "tests/test_basic.py")))))))
(propagated-inputs (list python-pandas)) (propagated-inputs (list python-pandas))
(inputs (list libiconv zlib)) (inputs (list libiconv zlib))
(native-inputs (list python-cython)) (native-inputs (list python-cython python-setuptools))
(home-page "https://github.com/Roche/pyreadstat") (home-page "https://github.com/Roche/pyreadstat")
(synopsis (synopsis
"Read and write SAS, SPSS and Stata files into/from Pandas DataFrames") "Read and write SAS, SPSS and Stata files into/from Pandas DataFrames")