From patchwork Sun Jan 7 16:40:35 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Troy Figiel X-Patchwork-Id: 58451 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 C24A027BBE2; Sun, 7 Jan 2024 16:51:17 +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=unavailable 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 8DBE327BBE9 for ; Sun, 7 Jan 2024 16:51:15 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rMWMU-00056N-2O; Sun, 07 Jan 2024 11:50:58 -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 1rMWMS-000569-Bn for guix-patches@gnu.org; Sun, 07 Jan 2024 11:50:56 -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 1rMWMS-0002qS-3a for guix-patches@gnu.org; Sun, 07 Jan 2024 11:50:56 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rMWMX-00018f-O5 for guix-patches@gnu.org; Sun, 07 Jan 2024 11:51:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#67143] [PATCH v2] gnu: Add python-pyreadstat. References: <877cmmn7jz.fsf@troyfigiel.com> In-Reply-To: <877cmmn7jz.fsf@troyfigiel.com> Resent-From: Troy Figiel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Sun, 07 Jan 2024 16:51:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 67143 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 67143@debbugs.gnu.org Received: via spool by 67143-submit@debbugs.gnu.org id=B67143.17046462364339 (code B ref 67143); Sun, 07 Jan 2024 16:51:01 +0000 Received: (at 67143) by debbugs.gnu.org; 7 Jan 2024 16:50:36 +0000 Received: from localhost ([127.0.0.1]:33642 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMWM8-00017v-4O for submit@debbugs.gnu.org; Sun, 07 Jan 2024 11:50:36 -0500 Received: from mout-p-101.mailbox.org ([2001:67c:2050:0:465::101]:40700) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rMWM5-00017e-Al for 67143@debbugs.gnu.org; Sun, 07 Jan 2024 11:50:34 -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-p-101.mailbox.org (Postfix) with ESMTPS id 4T7NV30T3Dz9spx for <67143@debbugs.gnu.org>; Sun, 7 Jan 2024 17:50:19 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=troyfigiel.com; s=MBO0001; t=1704646219; 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=ieLnIS8f6cw5ymX9HY5R6B8Mhi67mEyMk2oL4O791G4=; b=xsSwJABAWfYWJAf2OKhATYpJhCr6td9nkxgV86obDz9c24PtgO7/i0wFcS+sQZNTvE0JFx 2gxS1XhMhNTwzFYRpsmVefRifs9GbF4Us+CZVZg3i65wxQQyJ0HSeUUqueXGFSibyQ/28I FpTHEfjuR/ci8r+c5T4RGGfljh/4f0PfemfbqObZ5fR3PI1Xoq3K+A29kjp3gMcfZE1qIE 5x0U8juiDZB529/sPMOiTA7X/1xDjyYAwH3xhEpFaH/0t70nQnhhAf/E6lmhURxvk9JQ3Y LrtbUUw1pd5zmFbFmcCMNEEEhZ+dnDL7E5aw1WFx2GYVXZHxJ0ippeGVFIA5QQ== From: Troy Figiel Date: Sun, 7 Jan 2024 17:40:35 +0100 Message-ID: <87y1d1w0ja.fsf@troyfigiel.com> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4T7NV30T3Dz9spx 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. --- 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 base-commit: 5f8a993aa85554ca09bd27139230d7664107e1b6 diff --git a/gnu/local.mk b/gnu/local.mk index 3548b5eb3d..09c4dbaa46 100644 --- a/gnu/local.mk +++ b/gnu/local.mk @@ -62,6 +62,7 @@ # Copyright © 2023 B. Wilson # Copyright © 2023 gemmaro # Copyright © 2023 Herman Rimm +# Copyright © 2023 Troy Figiel # # This file is part of GNU Guix. # @@ -1775,6 +1776,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-pytorch2-system-libraries.patch \ %D%/packages/patches/python-sip-include-dirs.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 712b1a9c37..906ec456b6 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. ;;; @@ -6919,6 +6920,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 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 +@code{readstat}.") + (license license:asl2.0))) + (define-public r-quantpsyc (package (name "r-quantpsyc")