From: Troy Figiel <troy@troyfigiel.com>
To: 68721@debbugs.gnu.org
Subject: [bug#68721] [PATCH 1/2] gnu: Add python-cramjam.
Date: Thu, 25 Jan 2024 21:39:50 +0100 [thread overview]
Message-ID: <87jznxgjuf.fsf@troyfigiel.com> (raw)
In-Reply-To: <87le8dgjyu.fsf@troyfigiel.com>
* 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 <mail@nicolasgoaziou.fr>
;;; Copyright © 2020, 2022, 2023 Marius Bakke <marius@gnu.org>
;;; Copyright © 2021 Brendan Tildesley <mail@brendan.scot>
-;;; Copyright © 2023 Troy Figiel <troy@troyfigiel.com>
+;;; Copyright © 2023, 2024 Troy Figiel <troy@troyfigiel.com>
;;;
;;; 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")
--
2.42.0
next prev parent reply other threads:[~2024-01-25 21:55 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-01-25 21:41 [bug#68721] [PATCH 0/2] gnu: Add python-fastparquet Troy Figiel
2024-01-25 20:39 ` Troy Figiel [this message]
2024-01-25 20:45 ` [bug#68721] [PATCH 2/2] " Troy Figiel
2024-03-01 8:00 ` [bug#68721] [PATCH 0/2] " Sharlatan Hellseher
2024-03-02 18:40 ` [bug#68721] [PATCH 1/2] gnu: Add python-cramjam Troy Figiel
2024-03-02 18:40 ` [bug#68721] [PATCH 2/2] gnu: Add python-fastparquet Troy Figiel
2024-03-02 18:41 ` [bug#68721] [PATCH v2 0/2] " Troy Figiel
2024-03-03 8:16 ` bug#68721: [PATCH " Sharlatan Hellseher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87jznxgjuf.fsf@troyfigiel.com \
--to=troy@troyfigiel.com \
--cc=68721@debbugs.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this external index
https://git.savannah.gnu.org/cgit/guix.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.