diff options
Diffstat (limited to 'gnu/packages/python-compression.scm')
-rw-r--r-- | gnu/packages/python-compression.scm | 601 |
1 files changed, 364 insertions, 237 deletions
diff --git a/gnu/packages/python-compression.scm b/gnu/packages/python-compression.scm index 4361c0b65e..3c1713f6f6 100644 --- a/gnu/packages/python-compression.scm +++ b/gnu/packages/python-compression.scm @@ -1,6 +1,6 @@ ;;; GNU Guix --- Functional package management for GNU -;;; Copyright © 2017, 2018, 2023 Tobias Geerinckx-Rice <me@tobias.gr> -;;; Copyright © 2017, 2019, 2021, 2022 Ricardo Wurmus <rekado@elephly.net> +;;; Copyright © 2016, 2017, 2018, 2023 Tobias Geerinckx-Rice <me@tobias.gr> +;;; Copyright © 2017, 2018, 2019, 2021, 2022, 2023 Ricardo Wurmus <rekado@elephly.net> ;;; Copyright © 2017 Nikita <nikita@n0.is> ;;; Copyright © 2017 Julien Lepiller <julien@lepiller.eu> ;;; Copyright © 2018-2020, 2022, 2023 Efraim Flashner <efraim@flashner.co.il> @@ -10,7 +10,7 @@ ;;; Copyright © 2023, 2024 Troy Figiel <troy@troyfigiel.com> ;;; Copyright © 2024 TakeV <takev@disroot.org> ;;; Copyright © 2023 Ivan Vilata i Balaguer <ivan@selidor.net> -;;; Copyright © 2024 Maxim Cournoyer <maxim.cournoyer@gmail.com> +;;; Copyright © 2024 Maxim Cournoyer <maxim@guixotic.coop> ;;; Copyright © 2025 Nicolas Graves <ngraves@ngraves.fr> ;;; Copyright © 2025 Vinicius Monego <monego@posteo.net> ;;; @@ -34,6 +34,7 @@ #:use-module (guix utils) #:use-module (guix packages) #:use-module (guix download) + #:use-module (guix git-download) #:use-module (guix gexp) #:use-module (guix build-system cargo) #:use-module (guix build-system gnu) @@ -42,11 +43,10 @@ #:use-module (gnu packages) #:use-module (gnu packages libffi) #:use-module (gnu packages compression) - #:use-module (gnu packages crates-compression) - #:use-module (gnu packages crates-io) #:use-module (gnu packages cmake) #:use-module (gnu packages check) #:use-module (gnu packages maths) + #:use-module (gnu packages ninja) #:use-module (gnu packages pkg-config) #:use-module (gnu packages python) #:use-module (gnu packages python-build) @@ -54,39 +54,46 @@ #:use-module (gnu packages python-crypto) #:use-module (gnu packages python-science) #:use-module (gnu packages python-xyz) + #:use-module (gnu packages rust) #:use-module (gnu packages rust-apps) #:use-module (gnu packages sphinx)) (define-public python-blosc (package (name "python-blosc") - (version "1.11.1") + (version "1.11.3") (source (origin (method url-fetch) (uri (pypi-uri "blosc" version)) (sha256 (base32 - "0xmjs28sgpnb940zrhw010dq2m9d8a5h4fgnjyk6645fgfr1j8f2")) + "13h8ks58iy4h3ayk7havb4hmkma88598qkf4i4paj53qpa76bvc9")) (snippet #~(begin (use-modules (guix build utils)) (delete-file-recursively "blosc/c-blosc"))))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - (list #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'find-blosc - (lambda _ - (setenv "USE_SYSTEM_BLOSC" "1") - (setenv "Blosc_ROOT" #$(this-package-input "c-blosc")))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "python" "-m" "blosc.test"))))))) + (list + #:test-backend #~'custom + #:test-flags #~(list "-m" "blosc.test") + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'find-blosc + (lambda _ + (setenv "USE_SYSTEM_BLOSC" "1") + (setenv "Blosc_ROOT" #$(this-package-input "c-blosc"))))))) (propagated-inputs - (list python-scikit-build python-numpy)) - (inputs (list c-blosc)) - (native-inputs (list cmake-minimal)) + (list python-scikit-build)) + (inputs + (list c-blosc)) + (native-inputs + (list cmake-minimal + ninja/pinned + python-numpy + python-psutil + python-py-cpuinfo + python-setuptools)) (home-page "https://github.com/blosc/python-blosc") (synopsis "Python wrapper for the Blosc data compressor library") (description "Blosc is a high performance compressor optimized for binary @@ -111,17 +118,16 @@ This Python package wraps the Blosc library.") (uri (pypi-uri "blosc2" version)) (sha256 (base32 "1s4gpdf1hfbw5w3hpx0g8bfwjrws1b8wgmh7snafh5ivai0lvnrl")))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - (list #:phases #~(modify-phases %standard-phases - (replace 'build - (lambda* (#:key inputs #:allow-other-keys) - (invoke "python" "setup.py" "build" - "-DUSE_SYSTEM_BLOSC2=ON"))) - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "python" "-m" "pytest" "-vv"))))))) + (list + #:test-flags + #~(list "--pyargs" "blosc2") + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'configure + (lambda _ + (setenv "USE_SYSTEM_BLOSC2" "ON")))))) (inputs (list c-blosc2)) (propagated-inputs (list python-msgpack @@ -134,7 +140,8 @@ This Python package wraps the Blosc library.") pkg-config python-cython-3 python-pytest - python-scikit-build)) + python-scikit-build + python-setuptools)) (home-page "https://github.com/blosc/python-blosc2") (synopsis "Python wrapper for the Blosc2 data compressor library") (description @@ -151,6 +158,39 @@ Python-Blosc2 also reproduces the API of Python-Blosc and is meant to be able to access its data, so it can be used as a drop-in replacement.") (license license:bsd-3))) +(define-public python-brotli + (package + (name "python-brotli") + (version "1.0.9") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://github.com/google/brotli") + (commit (string-append "v" version)))) + (file-name (git-file-name name version)) + (sha256 + (base32 "1fikasxf7r2dwlk8mv8w7nmjkn0jw5ic31ky3mvpkdzwgd4xfndl")) + (modules '((guix build utils))) + (snippet + #~(begin + ;; Cherry-picked from upstream since the latest release + ;; https://github.com/google/brotli/commit/09b0992b6acb7faa6fd3b23f9bc036ea117230fc + (substitute* (find-files "scripts" "^lib.*pc\\.in") + (("-R\\$\\{libdir\\} ") "")))))) + (build-system pyproject-build-system) + (native-inputs + (list python-pytest + python-setuptools)) + (home-page "https://github.com/google/brotli") + (synopsis "Python interface to Brotli") + (description "This package provides a Python interface to the @code{brotli} +package, an implementation of the Brotli lossless compression algorithm.") + (license license:expat))) + +(define-public python-google-brotli + (deprecated-package "python-google-brotli" python-brotli)) + (define-public python-multivolumefile (package (name "python-multivolumefile") @@ -168,7 +208,6 @@ to access its data, so it can be used as a drop-in replacement.") python-coverage python-coveralls python-hypothesis - python-pyannotate python-pytest python-pytest-cov python-setuptools @@ -183,61 +222,52 @@ were a single file.") (define-public python-cramjam (package (name "python-cramjam") - (version "2.7.0") + (version "2.10.0") (source (origin (method url-fetch) (uri (pypi-uri "cramjam" version)) (sha256 - (base32 "1b69qlr0q7q3spa7zy55xc1dr5pjgsdavxx8ijhv2j60xqjbg7sp")))) - (build-system cargo-build-system) + (base32 "12kdwr313b8w8il4x1y9z366armd6lqv3hvpx4281bl4fd4ds8g8")))) + (build-system pyproject-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:) + #:modules '(((guix build cargo-build-system) #:prefix cargo:) + (guix build pyproject-build-system) (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 - pkg-config - python-pytest - python-pytest-xdist - python-numpy - python-hypothesis - python-wrapper)) - (inputs (list `(,zstd "lib"))) + (add-after 'unpack 'prepare-cargo-build-system + (lambda args + (for-each + (lambda (phase) + (format #t "Running cargo phase: ~a~%" phase) + (apply (assoc-ref cargo:%standard-phases phase) + #:cargo-target #$(cargo-triplet) + args)) + '(unpack-rust-crates + configure + check-for-pregenerated-files + patch-cargo-checksums))))))) + (native-inputs + (append + (list maturin + pkg-config + python-pytest + python-pytest-xdist + python-numpy + python-hypothesis + rust + `(,rust "cargo")) + (or (and=> (%current-target-system) + (compose list make-rust-sysroot)) + '()))) + (inputs + (cons* libdeflate + lz4 + `(,zstd "lib") + (cargo-inputs 'python-cramjam))) (home-page "https://github.com/milesgranger/cramjam") (synopsis "Python bindings to compression algorithms in Rust") (description @@ -327,23 +357,25 @@ filter for executable binaries. pybcj provides Python bindings to a BCJ implementation in C.") (license license:lgpl2.1+))) +;; XXX: Project is archived and not maintained since 2021. (define-public python-bcj-cffi (package (name "python-bcj-cffi") - (version "0.5.0") + (version "0.5.1") (source (origin (method url-fetch) (uri (pypi-uri "bcj-cffi" version)) (sha256 - (base32 - "1jcczrb8zgg6w7v76w1wpz3nw75fghk3xwxkn09ll7kck7sdf68d")))) - (build-system python-build-system) - (propagated-inputs - (list python-cffi python-toml python-setuptools-scm)) + (base32 "1k6h9x8j65hssbgmvhl71sdjj9aq8d81drdibrdflaz7a895sjib")))) + (build-system pyproject-build-system) (native-inputs - (list python-setuptools python-coverage python-pytest - python-pytest-cov)) + (list python-pytest + python-pytest-cov + python-setuptools + python-setuptools-scm)) + (propagated-inputs + (list python-cffi)) (home-page "https://github.com/miurahr/bcj-cffi") (synopsis "Branch / Call /Jump CFFI library in Python") (description "This package provides an implementation of the Branch / Call / @@ -354,31 +386,50 @@ Jump conversion filter by CFFI for Python.") (package (name "python-brotlicffi") (version "1.0.9.2") - (source (origin - (method url-fetch) - (uri (pypi-uri "brotlicffi" version)) - (sha256 - (base32 - "15kxgdiqcg0cm6h5xq3vkbhw7674673hcx3n2yicd3wx29l8l90c")) - (snippet - #~(begin - (use-modules (guix build utils)) - (delete-file-recursively "libbrotli"))))) + (source + (origin + (method url-fetch) + (uri (pypi-uri "brotlicffi" version)) + (sha256 + (base32 "15kxgdiqcg0cm6h5xq3vkbhw7674673hcx3n2yicd3wx29l8l90c")) + (snippet + #~(begin + (use-modules (guix build utils)) + (delete-file-recursively "libbrotli"))))) (build-system pyproject-build-system) (arguments (list - #:phases - #~(modify-phases %standard-phases - (add-after 'unpack 'use-shared-brotli - (lambda _ - (setenv "USE_SHARED_BROTLI" "1")))))) - (propagated-inputs (list python-cffi)) - (inputs (list brotli)) - (native-inputs (list python-setuptools python-wheel)) + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'use-shared-brotli + (lambda _ + (setenv "USE_SHARED_BROTLI" "1"))) + (add-before 'check 'set-brotli-source + (lambda _ + (let* ((brotli-source + #+(package-source (this-package-input "brotli"))) + (brotli-test-data + (string-append brotli-source "/tests/testdata")) + (brotli-version-source + (string-append brotli-source "/c/common/version.h"))) + (substitute* "test/conftest.py" + (("TEST_DATA_DIR = .*") + (format #f "TEST_DATA_DIR = ~s~%" brotli-test-data))) + (substitute* "test/test_compatibility.py" + (("open\\(version_h\\)") + (format #f "open(~s)" brotli-version-source))))))))) + (native-inputs + (list python-pytest + python-setuptools + python-wheel)) + (inputs + (list brotli)) + (propagated-inputs + (list python-cffi)) (home-page "https://github.com/python-hyper/brotlicffi") (synopsis "Python CFFI bindings to the Brotli library") - (description "This package provides Python CFFI bindings to the Brotli -library.") + (description + "This package provides Python CFFI bindings to the Brotli library.") (license license:expat))) (define-public python-inflate64 @@ -394,8 +445,7 @@ library.") (build-system pyproject-build-system) (propagated-inputs (list python-importlib-metadata)) (native-inputs - (list python-pyannotate - python-pytest + (list python-pytest python-setuptools-scm python-setuptools python-wheel)) @@ -409,25 +459,31 @@ compression algorithm.") (define-public python-isal (package (name "python-isal") - (version "1.1.0") + (version "1.8.0") (source (origin (method url-fetch) (uri (pypi-uri "isal" version)) (sha256 - (base32 "01914gwfrb95dagz9sqnsmvc0hssg2pb6aj204fdamss4piz8r0k")) + (base32 "1d7j30922v547vnif171yhk1jml9cv14izda0w506qhslglk6hhj")) ;; Remove bundled isa-l source code (modules '((guix build utils))) (snippet - '(delete-file-recursively "src/isal/isa-l")))) + #~(delete-file-recursively "src/isal/isa-l")))) (build-system pyproject-build-system) (arguments - `(#:phases - (modify-phases %standard-phases - (add-after 'unpack 'use-dynamic-linking - (lambda _ (setenv "PYTHON_ISAL_LINK_DYNAMIC" "1")))))) + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'use-dynamic-linking + (lambda _ + (setenv "PYTHON_ISAL_LINK_DYNAMIC" "1")))))) (inputs (list isa-l)) - (native-inputs (list python-cython python-setuptools python-wheel)) + (native-inputs + (list python-cython + python-pytest + python-setuptools + python-setuptools-scm)) (home-page "https://github.com/pycompression/python-isal") (synopsis "Python bindings for the ISA-L compression library") (description @@ -438,16 +494,16 @@ and decompression by implementing Python bindings for the ISA-L library.") (define-public python-pylsqpack (package (name "python-pylsqpack") - (version "0.3.17") + (version "0.3.22") (source (origin (method url-fetch) (uri (pypi-uri "pylsqpack" version)) (sha256 (base32 - "1qiwmavmxy6ba89mrdkzk52hqrd4awnp4yca395pxp2np66pf81g")))) + "1npcdj416gqc5zvlkyh9z808k381lrm56zvz1zsdjw437hdp2zxn")))) ;; FIXME: Unbundle ls-qpack and xxhash! (build-system pyproject-build-system) - (native-inputs (list python-setuptools python-wheel)) + (native-inputs (list python-pytest python-setuptools python-wheel)) (home-page "https://github.com/aiortc/pylsqpack") (synopsis "Python bindings for @code{ls-qpack}") (description @@ -485,6 +541,7 @@ compression algorithm variation H and I.2. It provides an API similar to Python's zlib/bz2/lzma modules.") (license license:lgpl2.1+))) +;; XXX: Project is archived and not maintained since 2022. (define-public python-ppmd-cffi (package (name "python-ppmd-cffi") @@ -496,15 +553,18 @@ Python's zlib/bz2/lzma modules.") (sha256 (base32 "0vprpl29fkflqx0m6anfpx7q7i4cw0d0qxcdm91k4pl82dcad81g")))) - (build-system python-build-system) + (build-system pyproject-build-system) + (arguments + (list + ;; AssertionError: assert False + #:test-flags #~(list "--deselect=tests/test_cli.py::test_cli_help"))) (propagated-inputs (list python-cffi)) (native-inputs - (list python-hypothesis - python-setuptools-scm - python-coverage - python-pytest - python-pytest-cov)) + (list python-pytest + python-pytest-cov + python-setuptools + python-setuptools-scm)) (home-page "https://github.com/miurahr/ppmd") (synopsis "Prediction by Partial Matching compression library") (description "PPMd is a compression algorithm library using the Prediction @@ -524,6 +584,10 @@ several possible methods.") (base32 "0lwniinfr3rb10n0c203a09vz06vxnnj637yqn8ipdlml89gj7kr")))) (build-system pyproject-build-system) + (arguments + (list + #:test-flags + #~(list "--ignore=tests/test_benchmark.py"))) (propagated-inputs (list python-brotli python-brotlicffi @@ -537,15 +601,12 @@ several possible methods.") python-pyzstd python-texttable)) (native-inputs - (list python-coverage - python-setuptools - python-coveralls + (list python-setuptools python-libarchive-c python-py-cpuinfo python-pyannotate python-pytest python-pytest-benchmark - python-pytest-cov python-pytest-remotedata python-pytest-timeout python-setuptools-scm @@ -560,29 +621,26 @@ Python.") (define-public python-lzo (package (name "python-lzo") - (version "1.14") + (version "1.15") (source (origin (method url-fetch) (uri (pypi-uri "python-lzo" version)) (sha256 - (base32 "0315nq6r39n51n8qqamb7xv0ib0qrh76q7g3a1977172mbndijw3")))) - (build-system python-build-system) + (base32 "0jbv6853p8flk65ks0nw37f6f5v0ryi6nhppv5fm3863ql0alym5")))) + (build-system pyproject-build-system) (arguments (list - #:test-target "check" #:phases #~(modify-phases %standard-phases (add-after 'unpack 'patch-setuppy - (lambda _ + (lambda* (#:key inputs #:allow-other-keys) (substitute* "setup.py" (("include_dirs.append\\(.*\\)") - (string-append "include_dirs.append('" - #$(this-package-input "lzo") - "/include/lzo" - "')")))))))) - (inputs - (list lzo)) + (format #f "include_dirs.append(~s)" + (search-input-directory inputs "include/lzo"))))))))) + (native-inputs (list python-pytest python-setuptools python-wheel)) + (inputs (list lzo)) (home-page "https://github.com/jd-boyd/python-lzo") (synopsis "Python bindings for the LZO data compression library") (description @@ -594,30 +652,28 @@ Python strings.") (define-public python-lz4 (package (name "python-lz4") - (version "4.3.2") + (version "4.4.4") (source (origin (method url-fetch) (uri (pypi-uri "lz4" version)) (sha256 (base32 - "1nmc36j5xnk7mvwwpm0nb1sddjk5iv77h877fdkkxcngm621shz1")) + "1nmb757fx3k30zsjiaz7nj6cgp4zxl44w28s4l8k0ff4grid03q7")) (modules '((guix build utils))) (snippet '(begin ;; Remove bundled copy of lz4. (delete-file-recursively "lz4libs"))))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments - (list #:phases - #~(modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - ;; Taken from tox.ini (excludes experimental tests). - (invoke "pytest" "-vv" "tests/block" "tests/frame"))))))) + ;; Taken from tox.ini (excludes experimental tests). + (list #:test-flags #~(list "tests/block" "tests/frame"))) (native-inputs - (list pkg-config python-pytest python-pkgconfig python-setuptools-scm - ;; For tests. + (list pkg-config + python-pytest + python-pkgconfig + python-setuptools + python-setuptools-scm python-psutil)) (inputs (list lz4)) @@ -638,9 +694,15 @@ the LZ4 frame format.") (method url-fetch) (uri (pypi-uri "lzstring" version)) (sha256 - (base32 - "18ly9pppy2yspxzw7k1b23wk77k7m44rz2g0271bqgqrk3jn3yhs")))) - (build-system python-build-system) + (base32 "18ly9pppy2yspxzw7k1b23wk77k7m44rz2g0271bqgqrk3jn3yhs")))) + (build-system pyproject-build-system) + (arguments + ;; No tests in PyPI, this project is a fork of + ;; <https://github.com/eduardtomasek/lz-string-python> and doesn't provide + ;; tags. + (list #:tests? #f)) + (native-inputs + (list python-setuptools)) (propagated-inputs (list python-future)) (home-page "https://github.com/gkovacs/lz-string-python") @@ -654,25 +716,21 @@ the LZ4 frame format.") ;; packages. To avoid a name collision in Guix, we use the variable name ;; `python-python-snappy' for the package called `python-snappy' on PyPI. (name "python-python-snappy") - (version "0.6.1") + (version "0.7.3") (source (origin (method url-fetch) - (uri (pypi-uri "python-snappy" version)) + (uri (pypi-uri "python_snappy" version)) (sha256 - (base32 "0amv12w0ybn6n1lk36x70a3l8bdjv4mn7iflb59wqsi00smhg8dn")))) - (build-system python-build-system) + (base32 "1qyfhsaagpzgrw5n2zklx670zi0f3lm1djqyg2n3hbgvmldnq8a0")))) + (build-system pyproject-build-system) (arguments - '(#:phases (modify-phases %standard-phases - (replace 'check - (lambda* (#:key tests? #:allow-other-keys) - (when tests? - (invoke "pytest" "-vv" "-k" - ;; CFFI is only supported for PyPy builds. - (string-append "not test_snappy_cffi_enum " - "and not test_snappy_all_cffi")))))))) - (inputs (list snappy)) - (native-inputs (list python-pytest)) + (list #:test-backend #~'unittest)) + (native-inputs + (list python-cramjam + python-setuptools)) + (inputs + (list snappy)) (home-page "https://github.com/andrix/python-snappy") (synopsis "Python bindings for the Snappy compression library") (description @@ -681,47 +739,52 @@ can be used to compress and decompress files and streams. It can also be used directly from the command line.") (license license:bsd-3))) -(define-public bitshuffle +(define-public python-bitshuffle (package - (name "bitshuffle") - (version "0.3.5") + (name "python-bitshuffle") + (version "0.5.2") (source (origin (method url-fetch) (uri (pypi-uri "bitshuffle" version)) (sha256 (base32 - "1823x61kyax4dc2hjmc1xraskxi1193y8lvxd03vqv029jrj8cjy")) + "139xz3m2m8sal8riicvmb9i0sq4085s2hc6c148bwhmzpnvky3nw")) (modules '((guix build utils))) (snippet '(begin + ;; TODO Remove bundled libraries: lz4, lzf, and zstd. ;; Remove generated Cython files. (delete-file "bitshuffle/h5.c") - (delete-file "bitshuffle/ext.c") - #t)))) - (build-system python-build-system) + (delete-file "bitshuffle/ext.c"))))) + (build-system pyproject-build-system) (arguments - `(#:tests? #f ; fail: https://github.com/h5py/h5py/issues/769 - #:phases - (modify-phases %standard-phases - (add-after 'unpack 'fix-neon-detection - ;; Neon is only for aarch64 ATM - ;; see: https://github.com/kiyo-masui/bitshuffle/pull/73 - (lambda _ - (substitute* "src/bitshuffle_core.c" - (("#define USEARMNEON") - "#ifdef __aarch64__\n#define USEARMNEON\n#endif")) - #t)) - (add-after 'unpack 'dont-build-native - (lambda _ - (substitute* "setup.py" - (("'-march=native', ") "")) - #t))))) - (inputs - `(("numpy" ,python-numpy) - ("h5py" ,python-h5py) - ("hdf5" ,hdf5))) + (list + #:test-flags + ;; FileNotFoundError: [Errno 2] Unable to synchronously open file + ;; (unable to open file: name = + ;; '/tmp/<...>/tests/data/regression_0.1.3.h5', errno = 2, error message + ;; = 'No such file or directory', flags = 0, o_flags = 0) + #~(list "--deselect=tests/test_regression.py::TestAll::test_regression") + #:phases + #~(modify-phases %standard-phases + (add-before 'build 'pre-build + ;; TODO: Check how to build on other architectures. + ;; Taken form .github/workflows/wheels.yml. + (lambda _ + #$@(if (target-x86-64?) + '((setenv "BITSHUFFLE_ARCH" "haswell") + (setenv "CIBW_SKIP" "pp* *musllinux* cp311-macosx*") + (setenv "CIBW_ARCHS" "x86_64")) + '()) + (setenv "HDF5_DIR" #$(this-package-input "hdf5"))))))) (native-inputs - `(("cython" ,python-cython))) + (list python-cython + python-pytest + python-setuptools)) + (inputs + (list python-numpy + python-h5py + hdf5)) (home-page "https://github.com/kiyo-masui/bitshuffle") (synopsis "Filter for improving compression of typed binary data") (description "Bitshuffle is an algorithm that rearranges typed, binary data @@ -729,20 +792,23 @@ for improving compression, as well as a python/C package that implements this algorithm within the Numpy framework.") (license license:expat))) +(define-public bitshuffle + (deprecated-package "bitshuffle" python-bitshuffle)) + (define-public bitshuffle-for-snappy - (package/inherit bitshuffle + (package/inherit python-bitshuffle (name "bitshuffle-for-snappy") (build-system gnu-build-system) (arguments - (substitute-keyword-arguments (package-arguments bitshuffle) - ((#:tests? _ #f) #f) - ((#:phases phases) - `(modify-phases %standard-phases - (replace 'configure - (lambda* (#:key outputs #:allow-other-keys) - (with-output-to-file "Makefile" - (lambda _ - (format #t "\ + (list + #:tests? #f + #:phases + #~(modify-phases %standard-phases + (replace 'configure + (lambda _ + (with-output-to-file "Makefile" + (lambda _ + (format #t "\ libbitshuffle.so: src/bitshuffle.o src/bitshuffle_core.o src/iochain.o lz4/lz4.o \tgcc -O3 -ffast-math -std=c99 -o $@ -shared -fPIC $^ @@ -761,11 +827,32 @@ install: libbitshuffle.so \tinstall -m644 src/bitshuffle_core.h $(INCLUDEDIR) \tinstall -m644 src/iochain.h $(INCLUDEDIR) \tinstall -m644 lz4/lz4.h $(INCLUDEDIR) -" (assoc-ref outputs "out")))) - #t)))))) +" #$output)))))))) (inputs '()) (native-inputs '()))) +(define-public python-uncompresspy + (package + (name "python-uncompresspy") + (version "0.4.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "uncompresspy" version)) + (sha256 + (base32 "1110dipshnijhq6dk5dxzxx3zpynm6dx5kcc430fw24b8xwlc9in")))) + (build-system pyproject-build-system) + (arguments + (list #:tests? #f)) ;no tests + (native-inputs + (list python-setuptools)) + (home-page "https://github.com/kYwzor/uncompresspy") + (synopsis "Uncompressing LZW files in Python") + (description + "This package implement a pure Python module for uncompressing LZW +files (.Z), such as the ones created by Unix's shell tool compress.") + (license license:bsd-3))) + (define-public python-unix-ar (package (name "python-unix-ar") @@ -796,19 +883,27 @@ Python.") (define-public python-zipp (package (name "python-zipp") - (version "1.0.0") + (version "3.23.0") (source (origin (method url-fetch) (uri (pypi-uri "zipp" version)) (sha256 - (base32 - "0v3qayhqv7vyzydpydwcp51bqciw8p2ajddw68x5k8zppc0vx3yk")))) - (build-system python-build-system) - (propagated-inputs - (list python-more-itertools)) + (base32 "0rj182i2d7d2bz067zrk39s19j09xsxkzprl82fqql8ji9c5fwd0")))) + (build-system pyproject-build-system) + (arguments (list #:tests? #f)) ;TODO: Tests requrie extra packaging (native-inputs - (list python-setuptools-scm)) + (list ;; python-big-o + ;; python-coherent-licensed + ;; python-jaraco-functools ; introduces cycle + ;; python-jaraco-itertools + ;; python-jaraco-test ; introduces cycle + python-more-itertools + python-pytest + ;; python-pytest-ignore-flaky + python-setuptools + python-setuptools-scm + python-wheel)) (home-page "https://github.com/jaraco/zipp") (synopsis "Backport of pathlib-compatible object wrapper for zip files") @@ -843,6 +938,37 @@ wrapper. It provides a backport of the @code{Path} object.") @code{libdeflate}.") (license license:expat))) +(define-public python-xopen + (package + (name "python-xopen") + ;; TODO: Newer versions require zlib-ng: + ;; <https://github.com/zlib-ng/zlib-ng>, + ;; <https://github.com/pycompression/python-zlib-ng>. + (version "1.8.0") + (source + (origin + (method url-fetch) + (uri (pypi-uri "xopen" version)) + (sha256 + (base32 "0h08wpd5zwnlzwnbbbhahbcs69kzsfbaaigqw0viq6ri8n4zrh00")))) + (build-system pyproject-build-system) + ;; tests: 343 passed, 5 skipped + (native-inputs + (list python-pytest + python-pytest-timeout + python-setuptools + python-setuptools-scm)) + (propagated-inputs + (list pigz python-isal)) + (home-page "https://github.com/marcelm/xopen/") + (synopsis "Open compressed files transparently") + (description "This module provides an @code{xopen} function that works +like Python's built-in @code{open} function, but can also deal with compressed +files. Supported compression formats are gzip, bzip2 and, xz, and are +automatically recognized by their file extensions. The focus is on being as +efficient as possible on all supported Python versions.") + (license license:expat))) + (define-public python-zipstream-ng (package (name "python-zipstream-ng") @@ -898,18 +1024,30 @@ generator") (define-public python-zstandard (package (name "python-zstandard") - (version "0.19.0") + (version "0.23.0") (source (origin (method url-fetch) (uri (pypi-uri "zstandard" version)) (sha256 - (base32 "0qvqhs121spk7yc1l20samflxx47waxv3xm55ksxpn1djk6jzl9i")))) - (build-system python-build-system) + (base32 "02dwqq5dw73zypvwpadscra8x6rwbglblh57yxl5y9g710nwdn5j")))) + (build-system pyproject-build-system) + ;; TODO: Unbunle zstd. + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'patch-build-system + (lambda _ + (substitute* "pyproject.toml" + ((":__legacy__") "")))) + (add-before 'check 'build-extensions + (lambda _ + (invoke "python" "setup.py" "build_ext" "--inplace")))))) + (native-inputs + (list python-pytest python-setuptools)) (propagated-inputs (list python-cffi)) - (native-inputs - (list python-hypothesis)) (home-page "https://github.com/indygreg/python-zstandard") (synopsis "Zstandard bindings for Python") (description "This project provides Python bindings for interfacing with @@ -932,27 +1070,16 @@ provided.") '(begin ;; Remove a bundled copy of the zstd sources. (delete-file-recursively "zstd"))))) - (build-system python-build-system) + (build-system pyproject-build-system) (arguments (list + ;; XXX: This is ugly. TODO python-team: + ;; Migrate pyproject to (json) instead of (guix build json). #:configure-flags - #~(list "--dynamic-link-zstd") - #:phases - #~(modify-phases %standard-phases - (replace 'build - ;; The python-build-system's phase doesn't honour configure-flags. - (lambda* (#:key configure-flags #:allow-other-keys) - (apply invoke "python" "./setup.py" "build" - configure-flags))) - (replace 'check - ;; The python-build-system's phase doesn't honour configure-flags. - (lambda* (#:key tests? test-target configure-flags - #:allow-other-keys) - (when tests? - (apply invoke "python" "./setup.py" test-target - configure-flags))))))) + #~`(@ . (("--build-option" . "--dynamic-link-zstd"))))) (inputs (list `(,zstd "lib"))) - (home-page "https://github.com/animalize/pyzstd") + (native-inputs (list python-pytest python-setuptools python-wheel)) + (home-page "https://github.com/Rogdham/pyzstd") (synopsis "Zstandard bindings for Python") (description "This package provides Python bindings to the Zstandard (zstd) compression library. The API is similar to Python's bz2/lzma/zlib module.") |