From patchwork Sun Nov 12 18:35:44 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Troy Figiel X-Patchwork-Id: 56392 Return-Path: X-Original-To: patchwork@mira.cbaines.net Delivered-To: patchwork@mira.cbaines.net Received: by mira.cbaines.net (Postfix, from userid 113) id 465AD27BBEA; Mon, 13 Nov 2023 03:12:50 +0000 (GMT) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on mira.cbaines.net X-Spam-Level: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,SPF_HELO_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mira.cbaines.net (Postfix) with ESMTPS id E9C5F27BBE9 for ; Mon, 13 Nov 2023 03:12:48 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1r2NN9-00017a-QG; Sun, 12 Nov 2023 22:12:23 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2NN7-00015p-QF for guix-patches@gnu.org; Sun, 12 Nov 2023 22:12:22 -0500 Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1r2NN7-0000xP-G0 for guix-patches@gnu.org; Sun, 12 Nov 2023 22:12:21 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1r2NNm-0008F2-G0 for guix-patches@gnu.org; Sun, 12 Nov 2023 22:13:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67143] [PATCH] gnu: Add python-pyreadstat 1.2.4. Resent-From: Troy Figiel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Mon, 13 Nov 2023 03:13:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 67143 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67143@debbugs.gnu.org X-Debbugs-Original-To: guix-patches@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.169984517931667 (code B ref -1); Mon, 13 Nov 2023 03:13:02 +0000 Received: (at submit) by debbugs.gnu.org; 13 Nov 2023 03:12:59 +0000 Received: from localhost ([127.0.0.1]:57272 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2NNh-0008Eb-92 for submit@debbugs.gnu.org; Sun, 12 Nov 2023 22:12:59 -0500 Received: from lists.gnu.org ([2001:470:142::17]:52708) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1r2FKT-0005uz-7M for submit@debbugs.gnu.org; Sun, 12 Nov 2023 13:37:09 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1r2FJi-0004EW-NF for guix-patches@gnu.org; Sun, 12 Nov 2023 13:36:18 -0500 Received: from mout-y-209.mailbox.org ([2001:67c:2050:103:465::209]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_CHACHA20_POLY1305:256) (Exim 4.90_1) (envelope-from ) id 1r2FJd-0001Vj-6r for guix-patches@gnu.org; Sun, 12 Nov 2023 13:36:17 -0500 Received: from smtp2.mailbox.org (smtp2.mailbox.org [IPv6:2001:67c:2050:b231:465::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-y-209.mailbox.org (Postfix) with ESMTPS id 4ST1Tz5nrfz9tjG for ; Sun, 12 Nov 2023 19:36:07 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=troyfigiel.com; s=MBO0001; t=1699814167; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=rz28BZ8eQZt2rcxmiOr8bgBoIqW1u8DqIonABDgsyTw=; b=b0aLggZMO/Hp1kQUiZekVD3XzGrf5ubpG0hOEBxzxWcuXspYcT6i/yMhkuHWtgN3hhJ858 mc88KUZYcCKvwW6vT7OBjgvt/G62oyykM0D1FV3FXfk5ygl4fohyMW+BYRQ8XpWuaD5SsO Usa06vMPp9z9B7GXgm51YU/O8QzBFrFdNrk4YeMVAtsRgMfb/hH+Znd1PY1bzNm1T/QTiz W4DYRQ2IVgHQzth8escX/NoMXbhKlMlCMOuhr7xvUXJmR1OrE7MlmYRioufGkTktU9wc9u YBiCo+Rk81UGRpRGOmXyyOPRPB32J9L5x0TlxuHahTWYBknT/yMgRzBeTluCAQ== From: Troy Figiel Date: Sun, 12 Nov 2023 19:35:44 +0100 Message-ID: <877cmmn7jz.fsf@troyfigiel.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4ST1Tz5nrfz9tjG Received-SPF: pass client-ip=2001:67c:2050:103:465::209; envelope-from=troy@troyfigiel.com; helo=mout-y-209.mailbox.org X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-Mailman-Approved-At: Sun, 12 Nov 2023 22:12:50 -0500 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: guix-patches@gnu.org List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org Sender: guix-patches-bounces+patchwork=mira.cbaines.net@gnu.org X-getmail-retrieved-from-mailbox: Patches * gnu/packages/statistics.scm (python-pyreadstat): New variable. Change-Id: I81ad6bf6a5644b783143a97466e12e1a127a7b9e --- gnu/local.mk | 2 + .../python-pyreadstat-link-libiconv.patch | 15 +++++++ gnu/packages/statistics.scm | 45 +++++++++++++++++++ 3 files changed, 62 insertions(+) create mode 100644 gnu/packages/patches/python-pyreadstat-link-libiconv.patch diff --git a/gnu/local.mk b/gnu/local.mk index e90df30068..734bec57c1 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -61,6 +61,7 @@ # Copyright © 2023 Andy Tai # Copyright © 2023 B. Wilson # Copyright © 2023 gemmaro +# Copyright © 2023 Troy Figiel # # This file is part of GNU Guix. # @@ -1759,6 +1760,7 @@ dist_patch_DATA = \ %D%/packages/patches/python-louvain-fix-test.patch \ %D%/packages/patches/python-random2-getrandbits-test.patch \ %D%/packages/patches/python-poppler-qt5-fix-build.patch \ + %D%/packages/patches/python-pyreadstat-link-libiconv.patch \ %D%/packages/patches/python-pypdf-annotate-tests-appropriately.patch \ %D%/packages/patches/python-sip-include-dirs.patch \ %D%/packages/patches/python-sgmllib3k-assertions.patch \ diff --git a/gnu/packages/patches/python-pyreadstat-link-libiconv.patch b/gnu/packages/patches/python-pyreadstat-link-libiconv.patch new file mode 100644 index 0000000000..7efd71faeb --- /dev/null +++ b/gnu/packages/patches/python-pyreadstat-link-libiconv.patch @@ -0,0 +1,15 @@ +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: + libraries.extend(["m", "z"]) + _platform = sys.platform + # Mac: iconv needs to be linked statically +- if _platform.lower().startswith("darwin"): +- libraries.append("iconv") ++ libraries.append("iconv") + + # Extensions + sources.sort() + diff --git a/gnu/packages/statistics.scm b/gnu/packages/statistics.scm index d15732c839..4280906d2a 100644 --- a/gnu/packages/statistics.scm +++ b/gnu/packages/statistics.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2021 Frank Pursel ;;; Copyright © 2022 Simon Tournier ;;; Copyright © 2023 gemmaro +;;; Copyright © 2023 Troy Figiel ;;; ;;; This file is part of GNU Guix. ;;; @@ -7019,6 +7020,50 @@ (define-public readstat popular stats packages like SAS, Stata and SPSS.") (license license:expat))) +(define-public python-pyreadstat + (package + (name "python-pyreadstat") + (version "1.2.4") + ;; No tests in the PyPI tarball. + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/Roche/pyreadstat") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0zysrzixvqw2lwwykxqg5yj8a0zyv5s2bmk22x30f4rj2hgvq1pv")) + (patches (search-patches "python-pyreadstat-link-libiconv.patch")))) + (arguments + '(#:phases (modify-phases %standard-phases + (add-before 'check 'change-home-dir + (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"))))))) + (build-system python-build-system) + (propagated-inputs (list python-pandas)) + (inputs (list libiconv zlib)) + (native-inputs (list python-cython-3)) + (home-page "https://github.com/Roche/pyreadstat") + (synopsis + "Read and write SAS, SPSS and Stata files into/from pandas data frames") + (description + "A Python package to read and write SAS (sas7bdat, sas7bcat, xport/xpt), +SPSS (sav, zsav, por) and Stata (dta) files into/from pandas data frames. It +is a wrapper around the C library readstat.") + (license license:asl2.0))) + (define-public r-quantpsyc (package (name "r-quantpsyc")