projects/guix·blob mpd-fix-groups · refs

1086 lines · 37.7 KiB

1;;; GNU Guix --- Functional package management for GNU
2;;; Copyright © 2016, 2017, 2018, 2023 Tobias Geerinckx-Rice <[email protected]>
3;;; Copyright © 2017, 2018, 2019, 2021, 2022, 2023 Ricardo Wurmus <[email protected]>
4;;; Copyright © 2017 Nikita <[email protected]>
5;;; Copyright © 2017 Julien Lepiller <[email protected]>
6;;; Copyright © 2018-2020, 2022, 2023 Efraim Flashner <[email protected]>
7;;; Copyright © 2020 Nicolas Goaziou <[email protected]>
8;;; Copyright © 2020, 2022, 2023 Marius Bakke <[email protected]>
9;;; Copyright © 2021 Brendan Tildesley <[email protected]>
10;;; Copyright © 2023, 2024 Troy Figiel <[email protected]>
11;;; Copyright © 2024 TakeV <[email protected]>
12;;; Copyright © 2023 Ivan Vilata i Balaguer <[email protected]>
13;;; Copyright © 2024 Maxim Cournoyer <[email protected]>
14;;; Copyright © 2025 Nicolas Graves <[email protected]>
15;;; Copyright © 2025 Vinicius Monego <[email protected]>
16;;;
17;;; This file is part of GNU Guix.
18;;;
19;;; GNU Guix is free software; you can redistribute it and/or modify it
20;;; under the terms of the GNU General Public License as published by
21;;; the Free Software Foundation; either version 3 of the License, or (at
22;;; your option) any later version.
23;;;
24;;; GNU Guix is distributed in the hope that it will be useful, but
25;;; WITHOUT ANY WARRANTY; without even the implied warranty of
26;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
27;;; GNU General Public License for more details.
28;;;
29;;; You should have received a copy of the GNU General Public License
30;;; along with GNU Guix. If not, see <http://www.gnu.org/licenses/>.
31
32(define-module (gnu packages python-compression)
33 #:use-module ((guix licenses) #:prefix license:)
34 #:use-module (guix utils)
35 #:use-module (guix packages)
36 #:use-module (guix download)
37 #:use-module (guix git-download)
38 #:use-module (guix gexp)
39 #:use-module (guix build-system cargo)
40 #:use-module (guix build-system gnu)
41 #:use-module (guix build-system python)
42 #:use-module (guix build-system pyproject)
43 #:use-module (gnu packages)
44 #:use-module (gnu packages libffi)
45 #:use-module (gnu packages compression)
46 #:use-module (gnu packages cmake)
47 #:use-module (gnu packages check)
48 #:use-module (gnu packages maths)
49 #:use-module (gnu packages ninja)
50 #:use-module (gnu packages pkg-config)
51 #:use-module (gnu packages python)
52 #:use-module (gnu packages python-build)
53 #:use-module (gnu packages python-check)
54 #:use-module (gnu packages python-crypto)
55 #:use-module (gnu packages python-science)
56 #:use-module (gnu packages python-xyz)
57 #:use-module (gnu packages rust)
58 #:use-module (gnu packages rust-apps)
59 #:use-module (gnu packages sphinx))
60
61(define-public python-blosc
62 (package
63 (name "python-blosc")
64 (version "1.11.3")
65 (source
66 (origin
67 (method url-fetch)
68 (uri (pypi-uri "blosc" version))
69 (sha256
70 (base32
71 "13h8ks58iy4h3ayk7havb4hmkma88598qkf4i4paj53qpa76bvc9"))
72 (snippet
73 #~(begin (use-modules (guix build utils))
74 (delete-file-recursively "blosc/c-blosc")))))
75 (build-system pyproject-build-system)
76 (arguments
77 (list
78 #:test-backend #~'custom
79 #:test-flags #~(list "-m" "blosc.test")
80 #:phases
81 #~(modify-phases %standard-phases
82 (add-after 'unpack 'find-blosc
83 (lambda _
84 (setenv "USE_SYSTEM_BLOSC" "1")
85 (setenv "Blosc_ROOT" #$(this-package-input "c-blosc")))))))
86 (propagated-inputs
87 (list python-scikit-build))
88 (inputs
89 (list c-blosc))
90 (native-inputs
91 (list cmake-minimal
92 ninja/pinned
93 python-numpy
94 python-psutil
95 python-py-cpuinfo
96 python-setuptools))
97 (home-page "https://github.com/blosc/python-blosc")
98 (synopsis "Python wrapper for the Blosc data compressor library")
99 (description "Blosc is a high performance compressor optimized for binary
100data. It has been designed to transmit data to the processor cache faster
101than the traditional, non-compressed, direct memory fetch approach via a
102@code{memcpy()} system call.
103
104Blosc works well for compressing numerical arrays that contains data with
105relatively low entropy, like sparse data, time series, grids with
106regular-spaced values, etc.
107
108This Python package wraps the Blosc library.")
109 (license license:bsd-3)))
110
111(define-public python-blosc2
112 (package
113 (name "python-blosc2")
114 (version "2.7.1") ;3.0.0 requires numpy>=1.25
115 (source
116 (origin
117 (method url-fetch)
118 (uri (pypi-uri "blosc2" version))
119 (sha256
120 (base32 "1s4gpdf1hfbw5w3hpx0g8bfwjrws1b8wgmh7snafh5ivai0lvnrl"))))
121 (build-system pyproject-build-system)
122 (arguments
123 (list
124 #:test-flags
125 #~(list "--pyargs" "blosc2")
126 #:phases
127 #~(modify-phases %standard-phases
128 (add-before 'build 'configure
129 (lambda _
130 (setenv "USE_SYSTEM_BLOSC2" "ON"))))))
131 (inputs (list c-blosc2))
132 (propagated-inputs
133 (list python-msgpack
134 python-ndindex
135 python-numexpr
136 python-numpy
137 python-py-cpuinfo))
138 (native-inputs
139 (list cmake-minimal
140 pkg-config
141 python-cython
142 python-pytest
143 python-scikit-build
144 python-setuptools))
145 (home-page "https://github.com/blosc/python-blosc2")
146 (synopsis "Python wrapper for the Blosc2 data compressor library")
147 (description
148 "Blosc2 is a high performance compressor optimized for binary
149data. It has been designed to transmit data to the processor cache faster
150than the traditional, non-compressed, direct memory fetch approach via a
151@code{memcpy()} system call.
152
153Python-Blosc2 wraps the C-Blosc2 library, and it aims to leverage its new API
154so as to support super-chunks, multi-dimensional arrays, serialization and
155other features introduced in C-Blosc2.
156
157Python-Blosc2 also reproduces the API of Python-Blosc and is meant to be able
158to access its data, so it can be used as a drop-in replacement.")
159 (license license:bsd-3)))
160
161(define-public python-brotli
162 (package
163 (name "python-brotli")
164 (version "1.0.9")
165 (source
166 (origin
167 (method git-fetch)
168 (uri (git-reference
169 (url "https://github.com/google/brotli")
170 (commit (string-append "v" version))))
171 (file-name (git-file-name name version))
172 (sha256
173 (base32 "1fikasxf7r2dwlk8mv8w7nmjkn0jw5ic31ky3mvpkdzwgd4xfndl"))
174 (modules '((guix build utils)))
175 (snippet
176 #~(begin
177 ;; Cherry-picked from upstream since the latest release
178 ;; https://github.com/google/brotli/commit/09b0992b6acb7faa6fd3b23f9bc036ea117230fc
179 (substitute* (find-files "scripts" "^lib.*pc\\.in")
180 (("-R\\$\\{libdir\\} ") ""))))))
181 (build-system pyproject-build-system)
182 (native-inputs
183 (list python-pytest
184 python-setuptools))
185 (home-page "https://github.com/google/brotli")
186 (synopsis "Python interface to Brotli")
187 (description "This package provides a Python interface to the @code{brotli}
188package, an implementation of the Brotli lossless compression algorithm.")
189 (license license:expat)))
190
191(define-deprecated-package python-google-brotli
192 python-brotli)
193
194(define-public python-multivolumefile
195 (package
196 (name "python-multivolumefile")
197 (version "0.2.3")
198 (source
199 (origin
200 (method url-fetch)
201 (uri (pypi-uri "multivolumefile" version))
202 (sha256
203 (base32
204 "1mh9sz50s1p8ik83a455pqd57syprad7xhfmk28yb5mwmw58sr50"))))
205 (build-system pyproject-build-system)
206 (native-inputs
207 (list python-setuptools-scm
208 python-coverage
209 python-coveralls
210 python-hypothesis
211 python-pytest
212 python-pytest-cov
213 python-setuptools
214 python-wheel))
215 (home-page "https://github.com/miurahr/multivolume")
216 (synopsis "Treat multiple files as one")
217 (description "MultiVolumefile is a Python library that provides a
218file-object abstraction, making it possible to use multiple files as if they
219were a single file.")
220 (license license:lgpl2.1+)))
221
222(define-public python-cramjam
223 (package
224 (name "python-cramjam")
225 (version "2.10.0")
226 (source
227 (origin
228 (method url-fetch)
229 (uri (pypi-uri "cramjam" version))
230 (sha256
231 (base32 "12kdwr313b8w8il4x1y9z366armd6lqv3hvpx4281bl4fd4ds8g8"))))
232 (build-system pyproject-build-system)
233 (arguments
234 (list
235 #:imported-modules `(,@%cargo-build-system-modules
236 ,@%pyproject-build-system-modules)
237 #:modules '(((guix build cargo-build-system) #:prefix cargo:)
238 (guix build pyproject-build-system)
239 (guix build utils))
240 #:phases #~(modify-phases %standard-phases
241 (add-after 'unpack 'prepare-cargo-build-system
242 (lambda args
243 (for-each
244 (lambda (phase)
245 (format #t "Running cargo phase: ~a~%" phase)
246 (apply (assoc-ref cargo:%standard-phases phase)
247 #:cargo-target #$(cargo-triplet)
248 args))
249 '(unpack-rust-crates
250 configure
251 check-for-pregenerated-files
252 patch-cargo-checksums)))))))
253 (native-inputs
254 (append
255 (list maturin
256 pkg-config
257 python-pytest
258 python-pytest-xdist
259 python-numpy
260 python-hypothesis
261 rust
262 `(,rust "cargo"))
263 (or (and=> (%current-target-system)
264 (compose list make-rust-sysroot))
265 '())))
266 (inputs
267 (cons* libdeflate
268 lz4
269 `(,zstd "lib")
270 (cargo-inputs 'python-cramjam)))
271 (home-page "https://github.com/milesgranger/cramjam")
272 (synopsis "Python bindings to compression algorithms in Rust")
273 (description
274 "This package provides thin Python bindings to compression and
275decomporession algorithms implemented in Rust. This allows for using
276algorithms such as Snappy without additional system dependencies. The
277following algorithms are available:
278
279@itemize
280@item Snappy
281@item Brotli
282@item Bzip2
283@item LZ4
284@item Gzip
285@item Deflate
286@item Zstd
287@end itemize")
288 (license license:expat)))
289
290(define-public python-ewah-bool-utils
291 (package
292 (name "python-ewah-bool-utils")
293 (version "1.2.2")
294 (source
295 (origin
296 (method url-fetch)
297 (uri (pypi-uri "ewah_bool_utils" version))
298 (sha256
299 (base32 "1hvs1fvf3g7kq6hnzxyxfrwvmykw503cmxf1l3irs67gr931z47b"))))
300 (build-system pyproject-build-system)
301 (arguments
302 (list
303 #:phases
304 #~(modify-phases %standard-phases
305 (add-before 'check 'build-extensions
306 (lambda _
307 (invoke "python" "setup.py" "build_ext" "--inplace"))))))
308 (native-inputs
309 (list python-cython
310 python-pytest
311 python-setuptools
312 python-wheel))
313 (propagated-inputs
314 (list python-numpy))
315 (home-page "https://github.com/yt-project/ewah_bool_utils")
316 (synopsis "EWAH Bool Array compression")
317 (description "This package provide a Python wrapper to @acronym{EWAH,
318 Enhanced Word-Aligned Hybrid} compression bitarray method.")
319 (license (list
320 ;; LICENSE: for Python code.
321 license:bsd-3
322 ;; XXX: Check if it's possible to have it as a dedicated package
323 ;; and link here..
324 ;; ewah_bool_utils/cpp/LICENSE: for C++ bundle, sourced from
325 ;; <https://github.com/lemire/EWAHBoolArray>.
326 license:asl2.0))))
327
328(define-public python-pybcj
329 (package
330 (name "python-pybcj")
331 (version "1.0.1")
332 (source (origin
333 (method url-fetch)
334 (uri (pypi-uri "pybcj" version))
335 (sha256
336 (base32
337 "1hvm3c3mb20z25kmbzyyn6pr5inx50z0ignl8b0bggxaik82ws4b"))))
338 (build-system pyproject-build-system)
339 (propagated-inputs (list python-importlib-metadata))
340 (native-inputs
341 (list python-coverage
342 python-hypothesis
343 python-pytest
344 python-pytest-cov
345 python-setuptools-scm
346 python-setuptools
347 python-wheel))
348 (home-page "https://codeberg.org/miurahr/pybcj")
349 (synopsis "BCJ filter library")
350 (description "In data compression, BCJ, short for Branch-Call-Jump, refers
351to a technique that improves the compression of machine code of executable
352binaries by replacing relative branch addresses with absolute ones. This
353allows a LZMA compressor to identify duplicate targets and archive higher
354compression rate. BCJ is used in the 7-zip compression utility as the default
355filter for executable binaries.
356
357pybcj provides Python bindings to a BCJ implementation in C.")
358 (license license:lgpl2.1+)))
359
360;; XXX: Project is archived and not maintained since 2021.
361(define-public python-bcj-cffi
362 (package
363 (name "python-bcj-cffi")
364 (version "0.5.1")
365 (source
366 (origin
367 (method url-fetch)
368 (uri (pypi-uri "bcj-cffi" version))
369 (sha256
370 (base32 "1k6h9x8j65hssbgmvhl71sdjj9aq8d81drdibrdflaz7a895sjib"))))
371 (build-system pyproject-build-system)
372 (native-inputs
373 (list python-pytest
374 python-pytest-cov
375 python-setuptools
376 python-setuptools-scm))
377 (propagated-inputs
378 (list python-cffi))
379 (home-page "https://github.com/miurahr/bcj-cffi")
380 (synopsis "Branch / Call /Jump CFFI library in Python")
381 (description "This package provides an implementation of the Branch / Call /
382Jump conversion filter by CFFI for Python.")
383 (license license:lgpl2.1+)))
384
385(define-public python-brotlicffi
386 (package
387 (name "python-brotlicffi")
388 (version "1.0.9.2")
389 (source
390 (origin
391 (method url-fetch)
392 (uri (pypi-uri "brotlicffi" version))
393 (sha256
394 (base32 "15kxgdiqcg0cm6h5xq3vkbhw7674673hcx3n2yicd3wx29l8l90c"))
395 (snippet
396 #~(begin
397 (use-modules (guix build utils))
398 (delete-file-recursively "libbrotli")))))
399 (build-system pyproject-build-system)
400 (arguments
401 (list
402 #:phases
403 #~(modify-phases %standard-phases
404 (add-after 'unpack 'use-shared-brotli
405 (lambda _
406 (setenv "USE_SHARED_BROTLI" "1")))
407 (add-before 'check 'set-brotli-source
408 (lambda _
409 (let* ((brotli-source
410 #+(package-source (this-package-input "brotli")))
411 (brotli-test-data
412 (string-append brotli-source "/tests/testdata"))
413 (brotli-version-source
414 (string-append brotli-source "/c/common/version.h")))
415 (substitute* "test/conftest.py"
416 (("TEST_DATA_DIR = .*")
417 (format #f "TEST_DATA_DIR = ~s~%" brotli-test-data)))
418 (substitute* "test/test_compatibility.py"
419 (("open\\(version_h\\)")
420 (format #f "open(~s)" brotli-version-source)))))))))
421 (native-inputs
422 (list python-pytest
423 python-setuptools
424 python-wheel))
425 (inputs
426 (list brotli))
427 (propagated-inputs
428 (list python-cffi))
429 (home-page "https://github.com/python-hyper/brotlicffi")
430 (synopsis "Python CFFI bindings to the Brotli library")
431 (description
432 "This package provides Python CFFI bindings to the Brotli library.")
433 (license license:expat)))
434
435(define-public python-inflate64
436 (package
437 (name "python-inflate64")
438 (version "0.3.1")
439 (source (origin
440 (method url-fetch)
441 (uri (pypi-uri "inflate64" version))
442 (sha256
443 (base32
444 "0767j35gkwaykl1iq9qn8rc25j1ggv56x3d1vzjpk89bzpzdhbdm"))))
445 (build-system pyproject-build-system)
446 (propagated-inputs (list python-importlib-metadata))
447 (native-inputs
448 (list python-pytest
449 python-setuptools-scm
450 python-setuptools
451 python-wheel))
452 (home-page "https://pypi.org/project/inflate64/")
453 (synopsis "Compression/decompression library")
454 (description "The @code{inflate64} package provides @code{Deflater} and
455@code{Inflater} classes to compress and decompress with the Enhanced Deflate
456compression algorithm.")
457 (license license:lgpl2.1+)))
458
459(define-public python-isal
460 (package
461 (name "python-isal")
462 (version "1.8.0")
463 (source
464 (origin
465 (method url-fetch)
466 (uri (pypi-uri "isal" version))
467 (sha256
468 (base32 "1d7j30922v547vnif171yhk1jml9cv14izda0w506qhslglk6hhj"))
469 ;; Remove bundled isa-l source code
470 (modules '((guix build utils)))
471 (snippet
472 #~(delete-file-recursively "src/isal/isa-l"))))
473 (build-system pyproject-build-system)
474 (arguments
475 (list
476 #:phases
477 #~(modify-phases %standard-phases
478 (add-after 'unpack 'use-dynamic-linking
479 (lambda _
480 (setenv "PYTHON_ISAL_LINK_DYNAMIC" "1"))))))
481 (inputs (list isa-l))
482 (native-inputs
483 (list python-cython
484 python-pytest
485 python-setuptools
486 python-setuptools-scm))
487 (home-page "https://github.com/pycompression/python-isal")
488 (synopsis "Python bindings for the ISA-L compression library")
489 (description
490 "This package aims to provide faster zlib and gzip compatible compression
491and decompression by implementing Python bindings for the ISA-L library.")
492 (license license:expat)))
493
494(define-public python-pylsqpack
495 (package
496 (name "python-pylsqpack")
497 (version "0.3.22")
498 (source (origin
499 (method url-fetch)
500 (uri (pypi-uri "pylsqpack" version))
501 (sha256
502 (base32
503 "1npcdj416gqc5zvlkyh9z808k381lrm56zvz1zsdjw437hdp2zxn"))))
504 ;; FIXME: Unbundle ls-qpack and xxhash!
505 (build-system pyproject-build-system)
506 (native-inputs (list python-pytest python-setuptools python-wheel))
507 (home-page "https://github.com/aiortc/pylsqpack")
508 (synopsis "Python bindings for @code{ls-qpack}")
509 (description
510 "@code{pylsqpack} is a wrapper around the @code{ls-qpack} library.
511It provides Python Decoder and Encoder objects to read or write HTTP/3
512headers compressed with QPACK.")
513 (license license:expat)))
514
515(define-public python-pyppmd
516 (package
517 (name "python-pyppmd")
518 (version "1.0.0")
519 (source (origin
520 (method url-fetch)
521 (uri (pypi-uri "pyppmd" version))
522 (sha256
523 (base32
524 "03w4x26mar0ha73c3v39psn1i0k6xrzwmaxfsxysic73jz99np07"))))
525 (build-system pyproject-build-system)
526 (native-inputs
527 (list python-coverage
528 python-hypothesis
529 python-pytest
530 python-pytest-benchmark
531 python-pytest-cov
532 python-pytest-timeout
533 python-setuptools-scm
534 python-setuptools
535 python-wheel))
536 (home-page "https://github.com/miurahr/pyppmd")
537 (synopsis "PPMd compression/decompression library")
538 (description "Pyppmd provides classes and functions for compressing and
539decompressing text data, using the @dfn{Prediction by partial matching} (PPM)
540compression algorithm variation H and I.2. It provides an API similar to
541Python's zlib/bz2/lzma modules.")
542 (license license:lgpl2.1+)))
543
544;; XXX: Project is archived and not maintained since 2022.
545(define-public python-ppmd-cffi
546 (package
547 (name "python-ppmd-cffi")
548 (version "0.5.0")
549 (source
550 (origin
551 (method url-fetch)
552 (uri (pypi-uri "ppmd-cffi" version))
553 (sha256
554 (base32
555 "0vprpl29fkflqx0m6anfpx7q7i4cw0d0qxcdm91k4pl82dcad81g"))))
556 (build-system pyproject-build-system)
557 (arguments
558 (list
559 ;; AssertionError: assert False
560 #:test-flags #~(list "--deselect=tests/test_cli.py::test_cli_help")))
561 (propagated-inputs
562 (list python-cffi))
563 (native-inputs
564 (list python-pytest
565 python-pytest-cov
566 python-setuptools
567 python-setuptools-scm))
568 (home-page "https://github.com/miurahr/ppmd")
569 (synopsis "Prediction by Partial Matching compression library")
570 (description "PPMd is a compression algorithm library using the Prediction
571by Partial Matching statistical technique. It is used in RAR and 7-Zip as one of
572several possible methods.")
573 (license license:lgpl2.1+)))
574
575(define-public python-py7zr
576 (package
577 (name "python-py7zr")
578 (version "0.20.2")
579 (source
580 (origin
581 (method url-fetch)
582 (uri (pypi-uri "py7zr" version))
583 (sha256
584 (base32
585 "0lwniinfr3rb10n0c203a09vz06vxnnj637yqn8ipdlml89gj7kr"))))
586 (build-system pyproject-build-system)
587 (arguments
588 (list
589 #:test-flags
590 #~(list "--ignore=tests/test_benchmark.py")))
591 (propagated-inputs
592 (list python-brotli
593 python-brotlicffi
594 python-importlib-metadata
595 python-inflate64
596 python-multivolumefile
597 python-psutil
598 python-pybcj
599 python-pycryptodomex
600 python-pyppmd
601 python-pyzstd
602 python-texttable))
603 (native-inputs
604 (list python-setuptools
605 python-libarchive-c
606 python-py-cpuinfo
607 python-pyannotate
608 python-pytest
609 python-pytest-benchmark
610 python-pytest-remotedata
611 python-pytest-timeout
612 python-setuptools-scm
613 python-wheel))
614 (home-page "https://github.com/miurahr/py7zr")
615 (synopsis "7-zip in Python")
616 (description "This package provides py7zr, which implements 7-zip
617archive compression, decompression, encryption and decryption in
618Python.")
619 (license license:lgpl2.1+)))
620
621(define-public python-lzo
622 (package
623 (name "python-lzo")
624 (version "1.15")
625 (source
626 (origin
627 (method url-fetch)
628 (uri (pypi-uri "python-lzo" version))
629 (sha256
630 (base32 "0jbv6853p8flk65ks0nw37f6f5v0ryi6nhppv5fm3863ql0alym5"))))
631 (build-system pyproject-build-system)
632 (arguments
633 (list
634 #:phases
635 #~(modify-phases %standard-phases
636 (add-after 'unpack 'patch-setuppy
637 (lambda* (#:key inputs #:allow-other-keys)
638 (substitute* "setup.py"
639 (("include_dirs.append\\(.*\\)")
640 (format #f "include_dirs.append(~s)"
641 (search-input-directory inputs "include/lzo")))))))))
642 (native-inputs (list python-pytest python-setuptools python-wheel))
643 (inputs (list lzo))
644 (home-page "https://github.com/jd-boyd/python-lzo")
645 (synopsis "Python bindings for the LZO data compression library")
646 (description
647 "Python-LZO provides Python bindings for LZO, i.e. you can access
648the LZO library from your Python scripts thereby compressing ordinary
649Python strings.")
650 (license license:gpl2+)))
651
652(define-public python-lz4
653 (package
654 (name "python-lz4")
655 (version "4.4.4")
656 (source
657 (origin
658 (method url-fetch)
659 (uri (pypi-uri "lz4" version))
660 (sha256
661 (base32
662 "1nmb757fx3k30zsjiaz7nj6cgp4zxl44w28s4l8k0ff4grid03q7"))
663 (modules '((guix build utils)))
664 (snippet '(begin
665 ;; Remove bundled copy of lz4.
666 (delete-file-recursively "lz4libs")))))
667 (build-system pyproject-build-system)
668 (arguments
669 ;; Taken from tox.ini (excludes experimental tests).
670 (list #:test-flags #~(list "tests/block" "tests/frame")))
671 (native-inputs
672 (list pkg-config
673 python-pytest
674 python-pkgconfig
675 python-setuptools
676 python-setuptools-scm
677 python-psutil))
678 (inputs
679 (list lz4))
680 (home-page "https://github.com/python-lz4/python-lz4")
681 (synopsis "LZ4 bindings for Python")
682 (description
683 "This package provides python bindings for the lz4 compression library
684by Yann Collet. The project contains bindings for the LZ4 block format and
685the LZ4 frame format.")
686 (license license:bsd-3)))
687
688(define-public python-lzstring
689 (package
690 (name "python-lzstring")
691 (version "1.0.4")
692 (source
693 (origin
694 (method url-fetch)
695 (uri (pypi-uri "lzstring" version))
696 (sha256
697 (base32 "18ly9pppy2yspxzw7k1b23wk77k7m44rz2g0271bqgqrk3jn3yhs"))))
698 (build-system pyproject-build-system)
699 (arguments
700 ;; No tests in PyPI, this project is a fork of
701 ;; <https://github.com/eduardtomasek/lz-string-python> and doesn't provide
702 ;; tags.
703 (list #:tests? #f))
704 (native-inputs
705 (list python-setuptools))
706 (propagated-inputs
707 (list python-future))
708 (home-page "https://github.com/gkovacs/lz-string-python")
709 (synopsis "String compression")
710 (description "Lz-string is a string compressor library for Python.")
711 (license license:expat)))
712
713(define-public python-python-snappy
714 (package
715 ;; PyPI contains both `snappy' and `python-snappy' as completely distinct
716 ;; packages. To avoid a name collision in Guix, we use the variable name
717 ;; `python-python-snappy' for the package called `python-snappy' on PyPI.
718 (name "python-python-snappy")
719 (version "0.7.3")
720 (source
721 (origin
722 (method url-fetch)
723 (uri (pypi-uri "python_snappy" version))
724 (sha256
725 (base32 "1qyfhsaagpzgrw5n2zklx670zi0f3lm1djqyg2n3hbgvmldnq8a0"))))
726 (build-system pyproject-build-system)
727 (arguments
728 (list #:test-backend #~'unittest))
729 (native-inputs
730 (list python-cramjam
731 python-setuptools))
732 (inputs
733 (list snappy))
734 (home-page "https://github.com/andrix/python-snappy")
735 (synopsis "Python bindings for the Snappy compression library")
736 (description
737 "@code{python-python-snappy} provides bindings to the Snappy library and
738can be used to compress and decompress files and streams. It can also be used
739directly from the command line.")
740 (license license:bsd-3)))
741
742(define-public python-bitshuffle
743 (package
744 (name "python-bitshuffle")
745 (version "0.5.2")
746 (source (origin
747 (method url-fetch)
748 (uri (pypi-uri "bitshuffle" version))
749 (sha256
750 (base32
751 "139xz3m2m8sal8riicvmb9i0sq4085s2hc6c148bwhmzpnvky3nw"))
752 (modules '((guix build utils)))
753 (snippet
754 '(begin
755 ;; TODO Remove bundled libraries: lz4, lzf, and zstd.
756 ;; Remove generated Cython files.
757 (delete-file "bitshuffle/h5.c")
758 (delete-file "bitshuffle/ext.c")))))
759 (build-system pyproject-build-system)
760 (arguments
761 (list
762 #:test-flags
763 ;; FileNotFoundError: [Errno 2] Unable to synchronously open file
764 ;; (unable to open file: name =
765 ;; '/tmp/<...>/tests/data/regression_0.1.3.h5', errno = 2, error message
766 ;; = 'No such file or directory', flags = 0, o_flags = 0)
767 #~(list "--deselect=tests/test_regression.py::TestAll::test_regression")
768 #:phases
769 #~(modify-phases %standard-phases
770 (add-before 'build 'pre-build
771 ;; TODO: Check how to build on other architectures.
772 ;; Taken form .github/workflows/wheels.yml.
773 (lambda _
774 #$@(if (target-x86-64?)
775 '((setenv "BITSHUFFLE_ARCH" "haswell")
776 (setenv "CIBW_SKIP" "pp* *musllinux* cp311-macosx*")
777 (setenv "CIBW_ARCHS" "x86_64"))
778 '())
779 (setenv "HDF5_DIR" #$(this-package-input "hdf5")))))))
780 (native-inputs
781 (list python-cython
782 python-pytest
783 python-setuptools))
784 (inputs
785 (list python-numpy
786 python-h5py
787 hdf5))
788 (home-page "https://github.com/kiyo-masui/bitshuffle")
789 (synopsis "Filter for improving compression of typed binary data")
790 (description "Bitshuffle is an algorithm that rearranges typed, binary data
791for improving compression, as well as a python/C package that implements this
792algorithm within the Numpy framework.")
793 (license license:expat)))
794
795(define-deprecated-package bitshuffle
796 python-bitshuffle)
797
798(define-public bitshuffle-for-snappy
799 (package/inherit python-bitshuffle
800 (name "bitshuffle-for-snappy")
801 (build-system gnu-build-system)
802 (arguments
803 (list
804 #:tests? #f
805 #:phases
806 #~(modify-phases %standard-phases
807 (replace 'configure
808 (lambda _
809 (with-output-to-file "Makefile"
810 (lambda _
811 (format #t "\
812libbitshuffle.so: src/bitshuffle.o src/bitshuffle_core.o src/iochain.o lz4/lz4.o
813\tgcc -O3 -ffast-math -std=c99 -o $@ -shared -fPIC $^
814
815%.o: %.c
816\tgcc -O3 -ffast-math -std=c99 -fPIC -Isrc -Ilz4 -c $< -o $@
817
818PREFIX:=~a
819LIBDIR:=$(PREFIX)/lib
820INCLUDEDIR:=$(PREFIX)/include
821
822install: libbitshuffle.so
823\tinstall -dm755 $(LIBDIR)
824\tinstall -dm755 $(INCLUDEDIR)
825\tinstall -m755 libbitshuffle.so $(LIBDIR)
826\tinstall -m644 src/bitshuffle.h $(INCLUDEDIR)
827\tinstall -m644 src/bitshuffle_core.h $(INCLUDEDIR)
828\tinstall -m644 src/iochain.h $(INCLUDEDIR)
829\tinstall -m644 lz4/lz4.h $(INCLUDEDIR)
830" #$output))))))))
831 (inputs '())
832 (native-inputs '())))
833
834(define-public python-uncompresspy
835 (package
836 (name "python-uncompresspy")
837 (version "0.4.0")
838 (source
839 (origin
840 (method url-fetch)
841 (uri (pypi-uri "uncompresspy" version))
842 (sha256
843 (base32 "1110dipshnijhq6dk5dxzxx3zpynm6dx5kcc430fw24b8xwlc9in"))))
844 (build-system pyproject-build-system)
845 (arguments
846 (list #:tests? #f)) ;no tests
847 (native-inputs
848 (list python-setuptools))
849 (home-page "https://github.com/kYwzor/uncompresspy")
850 (synopsis "Uncompressing LZW files in Python")
851 (description
852 "This package implement a pure Python module for uncompressing LZW
853files (.Z), such as the ones created by Unix's shell tool compress.")
854 (license license:bsd-3)))
855
856(define-public python-unix-ar
857 (package
858 (name "python-unix-ar")
859 (version "0.2.1")
860 (source
861 (origin
862 (method url-fetch)
863 (uri (pypi-uri "unix_ar" version))
864 (sha256
865 (base32 "0kicwxsh28x8r34a7cgzv2i65gsd4qjw2vf29pwq4fpsf3n2i4xz"))))
866 (build-system pyproject-build-system)
867 (arguments
868 ;; These tests have timestamp-related issues.
869 (list #:test-flags
870 #~(list "-m" "unittest" "-k" "not test_add and not test_addfile")
871 #:phases
872 #~(modify-phases %standard-phases
873 (replace 'check
874 (lambda* (#:key tests? test-flags #:allow-other-keys)
875 (apply invoke "python" test-flags))))))
876 (native-inputs (list python-pytest python-setuptools python-wheel))
877 (home-page "https://github.com/getninjas/unix_ar")
878 (synopsis "AR file handling in Python")
879 (description "This package provides utilities to handle AR files in
880Python.")
881 (license license:bsd-3)))
882
883(define-public python-zipp
884 (package
885 (name "python-zipp")
886 (version "3.23.0")
887 (source
888 (origin
889 (method url-fetch)
890 (uri (pypi-uri "zipp" version))
891 (sha256
892 (base32 "0rj182i2d7d2bz067zrk39s19j09xsxkzprl82fqql8ji9c5fwd0"))))
893 (build-system pyproject-build-system)
894 (arguments (list #:tests? #f)) ;TODO: Tests requrie extra packaging
895 (native-inputs
896 (list ;; python-big-o
897 ;; python-coherent-licensed
898 ;; python-jaraco-functools ; introduces cycle
899 ;; python-jaraco-itertools
900 ;; python-jaraco-test ; introduces cycle
901 python-more-itertools
902 python-pytest
903 ;; python-pytest-ignore-flaky
904 python-setuptools
905 python-setuptools-scm
906 python-wheel))
907 (home-page "https://github.com/jaraco/zipp")
908 (synopsis
909 "Backport of pathlib-compatible object wrapper for zip files")
910 (description
911 "This package provides a @code{pathlib}-compatible @code{Zipfile} object
912wrapper. It provides a backport of the @code{Path} object.")
913 (license license:expat)))
914
915(define-public python-deflate
916 (package
917 (name "python-deflate")
918 (version "0.8.0")
919 (source
920 (origin
921 (method url-fetch)
922 (uri (pypi-uri "deflate" version))
923 (sha256
924 (base32 "0cgk118r3sglrjqirr22y7mr7fnhijhwd3v6isykjbf2m2dqyy41"))))
925 (build-system pyproject-build-system)
926 (arguments
927 (list
928 #:phases #~(modify-phases %standard-phases
929 (add-after 'unpack 'libdeflate-prefix
930 (lambda _
931 (setenv "LIBDEFLATE_PREFIX"
932 #$(this-package-input "libdeflate")))))))
933 (native-inputs (list cmake-minimal python-pytest python-scikit-build-core))
934 (inputs (list libdeflate))
935 (home-page "https://github.com/dcwatson/deflate")
936 (synopsis "Python wrapper for @code{libdeflate}")
937 (description "This package contains a very thin Python wrapper for
938@code{libdeflate}.")
939 (license license:expat)))
940
941(define-public python-xopen
942 (package
943 (name "python-xopen")
944 ;; TODO: Newer versions require zlib-ng:
945 ;; <https://github.com/zlib-ng/zlib-ng>,
946 ;; <https://github.com/pycompression/python-zlib-ng>.
947 (version "1.8.0")
948 (source
949 (origin
950 (method url-fetch)
951 (uri (pypi-uri "xopen" version))
952 (sha256
953 (base32 "0h08wpd5zwnlzwnbbbhahbcs69kzsfbaaigqw0viq6ri8n4zrh00"))))
954 (build-system pyproject-build-system)
955 ;; tests: 343 passed, 5 skipped
956 (native-inputs
957 (list python-pytest
958 python-pytest-timeout
959 python-setuptools
960 python-setuptools-scm))
961 (propagated-inputs
962 (list pigz python-isal))
963 (home-page "https://github.com/marcelm/xopen/")
964 (synopsis "Open compressed files transparently")
965 (description "This module provides an @code{xopen} function that works
966like Python's built-in @code{open} function, but can also deal with compressed
967files. Supported compression formats are gzip, bzip2 and, xz, and are
968automatically recognized by their file extensions. The focus is on being as
969efficient as possible on all supported Python versions.")
970 (license license:expat)))
971
972(define-public python-zipstream-ng
973 (package
974 (name "python-zipstream-ng")
975 (version "1.7.1")
976 (source
977 (origin
978 (method url-fetch)
979 (uri (pypi-uri "zipstream-ng" version))
980 (sha256
981 (base32 "1z4zdqqs2rg3z36khgj96bpggv34av337isfv7yxg32prawj687r"))))
982 (build-system pyproject-build-system)
983 (native-inputs
984 (list python-pytest python-pytest-cov python-setuptools python-wheel))
985 (home-page "https://github.com/pR0Ps/zipstream-ng")
986 (synopsis "Streamable zip file generator")
987 (description
988 "This package provides a modern and easy to use streamable zip file
989generator")
990 (license license:lgpl3)))
991
992(define-public python-zopfli
993 (package
994 (name "python-zopfli")
995 (version "0.2.2")
996 (source
997 (origin
998 (method url-fetch)
999 (uri (pypi-uri "zopfli" version ".zip"))
1000 (sha256
1001 (base32 "1z1akqx3fjnwa75insch9p08hafikqdvqkj6mxv1k6fr81sxnj9d"))))
1002 (build-system python-build-system)
1003 (arguments
1004 (list
1005 #:phases #~(modify-phases %standard-phases
1006 (add-after 'unpack 'use-system-zopfli
1007 (lambda _
1008 (setenv "USE_SYSTEM_ZOPFLI" "1")))
1009 (add-before 'build 'set-version
1010 (lambda _
1011 (setenv "SETUPTOOLS_SCM_PRETEND_VERSION" #$version)))
1012 (replace 'check
1013 (lambda* (#:key tests? #:allow-other-keys)
1014 (when tests?
1015 (invoke "pytest" "-vv")))))))
1016 (native-inputs (list unzip python-pytest python-setuptools-scm))
1017 (inputs (list zopfli))
1018 (home-page "https://github.com/fonttools/py-zopfli")
1019 (synopsis "Python bindings for Zopfli")
1020 (description "@code{pyzopfli} is a straight forward wrapper around the
1021@code{ZlibCompress} method of the the @code{zopfli} library.")
1022 (license license:asl2.0)))
1023
1024(define-public python-zstandard
1025 (package
1026 (name "python-zstandard")
1027 (version "0.23.0")
1028 (source
1029 (origin
1030 (method url-fetch)
1031 (uri (pypi-uri "zstandard" version))
1032 (sha256
1033 (base32 "02dwqq5dw73zypvwpadscra8x6rwbglblh57yxl5y9g710nwdn5j"))))
1034 (build-system pyproject-build-system)
1035 ;; TODO: Unbunle zstd.
1036 (arguments
1037 (list
1038 #:phases
1039 #~(modify-phases %standard-phases
1040 (add-after 'unpack 'patch-build-system
1041 (lambda _
1042 (substitute* "pyproject.toml"
1043 ((":__legacy__") ""))))
1044 (add-before 'check 'build-extensions
1045 (lambda _
1046 (invoke "python" "setup.py" "build_ext" "--inplace"))))))
1047 (native-inputs
1048 (list python-pytest python-setuptools))
1049 (propagated-inputs
1050 (list python-cffi))
1051 (home-page "https://github.com/indygreg/python-zstandard")
1052 (synopsis "Zstandard bindings for Python")
1053 (description "This project provides Python bindings for interfacing with
1054the Zstandard compression library. A C extension and CFFI interface are
1055provided.")
1056 (license license:bsd-3)))
1057
1058(define-public python-pyzstd
1059 (package
1060 (name "python-pyzstd")
1061 (version "0.15.9")
1062 (source
1063 (origin
1064 (method url-fetch)
1065 (uri (pypi-uri "pyzstd" version))
1066 (sha256
1067 (base32 "1iycfmif15v1jhv0gsza1hyd1hn3sz0vn9s1y79abzv8axndxzfb"))
1068 (modules '((guix build utils)))
1069 (snippet
1070 '(begin
1071 ;; Remove a bundled copy of the zstd sources.
1072 (delete-file-recursively "zstd")))))
1073 (build-system pyproject-build-system)
1074 (arguments
1075 (list
1076 ;; XXX: This is ugly. TODO python-team:
1077 ;; Migrate pyproject to (json) instead of (guix build json).
1078 #:configure-flags
1079 #~`(@ . (("--build-option" . "--dynamic-link-zstd")))))
1080 (inputs (list `(,zstd "lib")))
1081 (native-inputs (list python-pytest python-setuptools python-wheel))
1082 (home-page "https://github.com/Rogdham/pyzstd")
1083 (synopsis "Zstandard bindings for Python")
1084 (description "This package provides Python bindings to the Zstandard (zstd)
1085compression library. The API is similar to Python's bz2/lzma/zlib module.")
1086 (license license:bsd-3)))