From patchwork Thu Jan 25 20:39:50 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Troy Figiel X-Patchwork-Id: 59402 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 E2FEE27BBEA; Thu, 25 Jan 2024 21:55: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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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 EC10A27BBE2 for ; Thu, 25 Jan 2024 21:55:16 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rT7gY-0001mb-Da; Thu, 25 Jan 2024 16:54: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 1rT7gW-0001mS-HT for guix-patches@gnu.org; Thu, 25 Jan 2024 16:54: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 1rT7gV-0007Vu-Nt for guix-patches@gnu.org; Thu, 25 Jan 2024 16:54:56 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rT7gb-0002fC-Oz for guix-patches@gnu.org; Thu, 25 Jan 2024 16:55:01 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68721] [PATCH 1/2] gnu: Add python-cramjam. References: <87le8dgjyu.fsf@troyfigiel.com> In-Reply-To: <87le8dgjyu.fsf@troyfigiel.com> Resent-From: Troy Figiel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Jan 2024 21:55:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68721 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68721@debbugs.gnu.org Received: via spool by 68721-submit@debbugs.gnu.org id=B68721.170621967310193 (code B ref 68721); Thu, 25 Jan 2024 21:55:01 +0000 Received: (at 68721) by debbugs.gnu.org; 25 Jan 2024 21:54:33 +0000 Received: from localhost ([127.0.0.1]:49440 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rT7g8-0002eK-Tk for submit@debbugs.gnu.org; Thu, 25 Jan 2024 16:54:33 -0500 Received: from mout-p-102.mailbox.org ([80.241.56.152]:37636) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rT7g7-0002e3-62 for 68721@debbugs.gnu.org; Thu, 25 Jan 2024 16:54:31 -0500 Received: from smtp102.mailbox.org (smtp102.mailbox.org [10.196.197.102]) (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-102.mailbox.org (Postfix) with ESMTPS id 4TLZNT2z7Sz9spm for <68721@debbugs.gnu.org>; Thu, 25 Jan 2024 22:54:17 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=troyfigiel.com; s=MBO0001; t=1706219657; 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=hUQxsBgsz+E1FJjYZksxD97udWTTTKS64VJhz02Hru0=; b=Ehs+Vi23jNbPIR1CREEuxOJGR613xcryLSueRKlM7w2K5B5JqZso3/ho0NFhKVb41k334g JACtfZw1icbw86qsRRciMe8Vo/H4VnRHnh6xTeCmrEjtYCPfbpA2TAY9BK14VVfQ4M/B+K vGx74EXmZM6UBl7zACccB3YKJH4hjX5Je9gxzvBfh0QXjxZH0CNDnXJ3JecgmjgQXcqjDN 4a2JL0w+pSsrdkycyDM8P2239cXva+c0Li8iU/O61Xijgk/JQFu2Ynb7zqDCCSIHTdMgGj BeGs5ZsayRqoAm+W0oLDh5Eiun4aLE8D2m3LSl1vpZBbA8LEgV/7zDKuAZ/y9Q== From: Troy Figiel Date: Thu, 25 Jan 2024 21:39:50 +0100 Message-ID: <87jznxgjuf.fsf@troyfigiel.com> MIME-Version: 1.0 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/python-compression.scm (python-cramjam): New variable. --- gnu/packages/python-compression.scm | 80 ++++++++++++++++++++++++++++- 1 file changed, 79 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python-compression.scm b/gnu/packages/python-compression.scm index 6f249dd3af..691fbd3065 100644 --- a/gnu/packages/python-compression.scm +++ b/gnu/packages/python-compression.scm @@ -7,7 +7,7 @@ ;;; Copyright © 2020 Nicolas Goaziou ;;; Copyright © 2020, 2022, 2023 Marius Bakke ;;; Copyright © 2021 Brendan Tildesley -;;; Copyright © 2023 Troy Figiel +;;; Copyright © 2023, 2024 Troy Figiel ;;; ;;; This file is part of GNU Guix. ;;; @@ -30,12 +30,14 @@ (define-module (gnu packages python-compression) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix gexp) + #:use-module (guix build-system cargo) #:use-module (guix build-system gnu) #:use-module (guix build-system python) #:use-module (guix build-system pyproject) #:use-module (gnu packages) #:use-module (gnu packages libffi) #:use-module (gnu packages compression) + #:use-module (gnu packages crates-io) #:use-module (gnu packages check) #:use-module (gnu packages maths) #:use-module (gnu packages pkg-config) @@ -44,6 +46,7 @@ (define-module (gnu packages python-compression) #:use-module (gnu packages python-check) #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-xyz) + #:use-module (gnu packages rust-apps) #:use-module (gnu packages sphinx)) (define-public python-multivolumefile @@ -73,6 +76,81 @@ (define-public python-multivolumefile were a single file.") (license license:lgpl2.1+))) +(define-public python-cramjam + (package + (name "python-cramjam") + (version "2.7.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "cramjam" version)) + (sha256 + (base32 "1b69qlr0q7q3spa7zy55xc1dr5pjgsdavxx8ijhv2j60xqjbg7sp")))) + (build-system cargo-build-system) + (arguments + (list + #:imported-modules `(,@%cargo-build-system-modules + ,@%pyproject-build-system-modules) + #:modules '((guix build cargo-build-system) + ((guix build pyproject-build-system) + #:prefix py:) + (guix build utils)) + #:phases #~(modify-phases %standard-phases + ;; We use Maturin to build the project. + (replace 'build + (assoc-ref py:%standard-phases + 'build)) + ;; Before being able to run Python tests, we need to + ;; install the module and add it to PYTHONPATH. + (delete 'install) + (add-after 'build 'install + (assoc-ref py:%standard-phases + 'install)) + (add-after 'install 'add-install-to-pythonpath + (assoc-ref py:%standard-phases + 'add-install-to-pythonpath)) + ;; Finally run the tests. Only Python tests are provided. + (replace 'check + (lambda* (#:key tests? inputs outputs #:allow-other-keys) + (when tests? + ;; Without the CI variable, tests are run in "local" + ;; mode, which sets a deadline for hypothesis. For a + ;; deterministic build, we need to set CI. + (setenv "CI" "1") + (invoke "pytest" "-vv" "tests"))))) + #:cargo-inputs `(("rust-brotli" ,rust-brotli-3) + ("rust-bzip2" ,rust-bzip2-0.4) + ("rust-flate2" ,rust-flate2-1) + ("rust-lz4" ,rust-lz4-1) + ("rust-pyo3" ,rust-pyo3-0.18) + ("rust-snap" ,rust-snap-1) + ("rust-zstd" ,rust-zstd-0.11)) + #:install-source? #f)) + (native-inputs (list maturin + python-pytest + python-pytest-xdist + python-numpy + python-hypothesis + python-wrapper)) + (home-page "https://github.com/milesgranger/cramjam") + (synopsis "Python bindings to compression algorithms in Rust") + (description + "This package provides thin Python bindings to compression and +decomporession algorithms implemented in Rust. This allows for using +algorithms such as Snappy without additional system dependencies. The +following algorithms are available: + +@itemize +@item Snappy +@item Brotli +@item Bzip2 +@item LZ4 +@item Gzip +@item Deflate +@item Zstd +@end itemize") + (license license:expat))) + (define-public python-pybcj (package (name "python-pybcj") From patchwork Thu Jan 25 20:45:20 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Troy Figiel X-Patchwork-Id: 59403 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 4D5D527BBE9; Thu, 25 Jan 2024 21:56:15 +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=-3.7 required=5.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_MSPIKE_H5,RCVD_IN_MSPIKE_WL, 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 C0E9927BBE2 for ; Thu, 25 Jan 2024 21:56:13 +0000 (GMT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rT7hW-0001yy-Pr; Thu, 25 Jan 2024 16:55: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 1rT7hU-0001yb-QZ for guix-patches@gnu.org; Thu, 25 Jan 2024 16:55: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 1rT7hU-000873-7X for guix-patches@gnu.org; Thu, 25 Jan 2024 16:55:56 -0500 Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rT7ha-0002h1-8V for guix-patches@gnu.org; Thu, 25 Jan 2024 16:56:02 -0500 X-Loop: help-debbugs@gnu.org Subject: [bug#68721] [PATCH 2/2] gnu: Add python-fastparquet. References: <87le8dgjyu.fsf@troyfigiel.com> In-Reply-To: <87le8dgjyu.fsf@troyfigiel.com> Resent-From: Troy Figiel Original-Sender: "Debbugs-submit" Resent-CC: guix-patches@gnu.org Resent-Date: Thu, 25 Jan 2024 21:56:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 68721 X-GNU-PR-Package: guix-patches X-GNU-PR-Keywords: patch To: 68721@debbugs.gnu.org Received: via spool by 68721-submit@debbugs.gnu.org id=B68721.170621971610289 (code B ref 68721); Thu, 25 Jan 2024 21:56:02 +0000 Received: (at 68721) by debbugs.gnu.org; 25 Jan 2024 21:55:16 +0000 Received: from localhost ([127.0.0.1]:49445 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rT7gp-0002ft-HD for submit@debbugs.gnu.org; Thu, 25 Jan 2024 16:55:15 -0500 Received: from mout-p-201.mailbox.org ([80.241.56.171]:59598) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rT7gn-0002fd-8a for 68721@debbugs.gnu.org; Thu, 25 Jan 2024 16:55:14 -0500 Received: from smtp2.mailbox.org (smtp2.mailbox.org [10.196.197.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-201.mailbox.org (Postfix) with ESMTPS id 4TLZPH0rM6z9sSt for <68721@debbugs.gnu.org>; Thu, 25 Jan 2024 22:54:59 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=troyfigiel.com; s=MBO0001; t=1706219699; 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=Zkg91YTs7YyxwTvavfPDivhn+hKr5tQguTgbjY6LNO8=; b=Bdt4vjxGk8eW+OJeGq04WzGlXK+gUCclJgKAli9kOuoO5bdqw0DpFHi8AC9vxpSq2j15Yk /isTismywMcByjyJy037NUJuFUpD9Ug8QCwbjpYlkwEIdfQPpsHkGEbdgXI2ehzCCywGUt WD6Lb4loTsiC/Iedh7xVYgYx6nzKquO8nyfEnDu0R21w4C1daouWNQ+ydtLk8KTurnXD9P n8GAFe8RHAG1J1lozGUmJnupAaoEta+3ni7nJ9mSgfXYwz6FM3T7Swmf4ka4e0BfWqU6KD aU6MQQDpIlnXqCJrcGTzbCo3WQCLJOh4ZUxWdZIG/C5XusR9NX+AUOeLi+3owA== From: Troy Figiel Date: Thu, 25 Jan 2024 21:45:20 +0100 Message-ID: <87il3hgjt9.fsf@troyfigiel.com> MIME-Version: 1.0 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/databases.scm (python-fastparquet): New variable. --- gnu/packages/databases.scm | 67 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) diff --git a/gnu/packages/databases.scm b/gnu/packages/databases.scm index b56767d311..66f7f7d951 100644 --- a/gnu/packages/databases.scm +++ b/gnu/packages/databases.scm @@ -62,6 +62,7 @@ ;;; Copyright © 2023 Felix Gruber ;;; Copyright © 2023 Giacomo Leidi +;;; Copyright © 2024 Troy Figiel ;;; ;;; This file is part of GNU Guix. ;;; @@ -142,6 +143,7 @@ (define-module (gnu packages databases) #:use-module (gnu packages python) #:use-module (gnu packages python-build) #:use-module (gnu packages python-check) + #:use-module (gnu packages python-compression) #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-science) #:use-module (gnu packages python-web) @@ -4896,6 +4898,71 @@ (define-public python-pyarrow-0.16 other traditional Python scientific computing packages.") (license license:asl2.0))) +(define-public python-fastparquet + (package + (name "python-fastparquet") + (version "2023.10.1") + (source + (origin + ;; Fastparquet uses setuptools-scm to find the current version. This + ;; only works when we use the PyPI tarball, which does not contain + ;; tests. Instead, we use the git-fetch method and add the version back + ;; ourselves. + (method git-fetch) + (uri (git-reference + (url "https://github.com/dask/fastparquet") + (commit version))) + (file-name (git-file-name name version)) + (sha256 + (base32 "0msc2n4sjbq3h5pq6l94rfx27v0aqrk5cxbpg3yssr74gwx26h4r")) + (modules '((guix build utils))) + (snippet '(substitute* "setup.py" + ;; Remove dependencies on git and setuptools-scm. + (("^.*\"git\", \"status\".*$") + "") + (("'setuptools-scm>1.5.4',") + "") + ;; Guix is only compatible with a single version of numpy + ;; at a time. We can safely remove this dependency. + (("'oldest-supported-numpy'") + ""))))) + (build-system pyproject-build-system) + (arguments + (list + #:phases #~(modify-phases %standard-phases + ;; Make sure to add back the missing version information + ;; the build phase. + (add-after 'unpack 'set-version + (lambda _ + (call-with-output-file "fastparquet/_version.py" + (lambda (port) + (format port "__version__ = ~a" + (string-append "\"" + #$version "\"")))))) + ;; Cython extensions need to be built for the check phase. + (add-before 'check 'build-cython-extensions + (lambda _ + (invoke "python" "setup.py" "build_ext" "--inplace")))))) + (propagated-inputs (list python-cramjam python-fsspec python-numpy + python-packaging python-pandas)) + (native-inputs (list python-cython python-pytest-runner)) + (home-page "https://github.com/dask/fastparquet") + (synopsis "Python implementation of the Parquet file format") + (description + "@code{fastparquet} is a Python implementation of the Parquet file +format. @code{fastparquet} is used implicitly by @code{dask}, @code{pandas} +and @code{intake-parquet}. It supports the following compression algorithms: + +@itemize +@item Gzip +@item Snappy +@item Brotli +@item LZ4 +@item Zstd +@item LZO (optionally) +@end itemize") + (license license:asl2.0))) + (define-public python-crate (package (name "python-crate")