This is an automated email from the git hooks/post-receive script.

guix_mirror_bot pushed a commit to branch master
in repository guix.

The following commit(s) were added to refs/heads/master by this push:
     new d6e85a9baf gnu: Add python-backports-zstd.
d6e85a9baf is described below

commit d6e85a9baf784e6929ad3606a96408a72eb0ccfc
Author: Ghislain Vaillant <[email protected]>
AuthorDate: Fri Dec 26 09:19:08 2025 +0100

    gnu: Add python-backports-zstd.
    
    * gnu/packages/python-compression.scm (python-backports-zstd): New variable.
    
    Change-Id: Ida22c9d39e5f2191bf97532cce537a0a9d8f9682
    Modified-by: Sharlatan Hellseher <[email protected]>
    Signed-off-by: Sharlatan Hellseher <[email protected]>
---
 gnu/packages/python-compression.scm | 52 +++++++++++++++++++++++++++++++++++++
 1 file changed, 52 insertions(+)

diff --git a/gnu/packages/python-compression.scm 
b/gnu/packages/python-compression.scm
index b996cc5fa9..d0e5571dfe 100644
--- a/gnu/packages/python-compression.scm
+++ b/gnu/packages/python-compression.scm
@@ -58,6 +58,58 @@
   #:use-module (gnu packages rust-apps)
   #:use-module (gnu packages sphinx))
 
+(define-public python-backports-zstd
+  (package
+    (name "python-backports-zstd")
+    (version "1.2.0")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+              (url "https://github.com/rogdham/backports.zstd";)
+              (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "08dlr3zfk6fsn9g99msy2ap43c740hmc1l1c4xccigkrkjn9p0sp"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      ;; tests: 1249 passed
+      #:test-backend #~'unittest
+      #:test-flags #~(list "discover" "tests")
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-after 'unpack 'use-system-zstd
+            (lambda _
+              (substitute* "setup.py"
+                (("_SYSTEM_ZSTD = False")
+                 "_SYSTEM_ZSTD = True"))))
+          (add-after 'unpack 'skip-copy-of-zstd-license
+            (lambda _
+              (substitute* "setup.py"
+                (("f.write.*read_text.*")
+                 ""))))
+          (add-after 'unpack 'skip-tests-requiring-root
+            (lambda _
+              (substitute* "tests/test/test_tarfile.py"
+                (("import pwd, grp")
+                 "return False"))))
+          (add-before 'check 'pre-check
+            (lambda _
+              ;; Skip tests that may fail when using the system library.
+              (setenv "BACKPORTSZSTD_SKIP_EXTENSION_TEST" "1"))))))
+    (native-inputs
+     (list pythoncapi-compat
+           python-setuptools))
+    (inputs
+     (list (list zstd "lib")))
+    (home-page "https://peps.python.org/pep-0784/";)
+    (synopsis "Backport of compression.zstd for Python")
+    (description
+     "This package provides a backport of the compression.zstd module for
+Python versions below 3.14.")
+    (license license:psfl)))
+
 (define-public python-blosc
   (package
     (name "python-blosc")

Reply via email to