From d1836f60cf906a5e6d4943b9818b8d8385d914ea Mon Sep 17 00:00:00 2001 From: Vivien Kraus Date: Thu, 20 Jan 2022 15:47:30 +0100 Subject: [PATCH v6 02/28] gnu: Add python-edflib. * gnu/packages/python-science.scm (python-edflib): New variable. --- gnu/packages/python-science.scm | 65 ++++++++++++++++++++++++++++++++- 1 file changed, 64 insertions(+), 1 deletion(-) diff --git a/gnu/packages/python-science.scm b/gnu/packages/python-science.scm index 6bc726fc83..49f0322c51 100644 --- a/gnu/packages/python-science.scm +++ b/gnu/packages/python-science.scm @@ -18,6 +18,7 @@ ;;; Copyright © 2022 Malte Frank Gerdes ;;; Copyright © 2022 Guillaume Le Vaillant ;;; Copyright © 2022 Paul A. Patience +;;; Copyright © 2022 Vivien Kraus ;;; ;;; This file is part of GNU Guix. ;;; @@ -68,7 +69,8 @@ (define-module (gnu packages python-science) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix utils) - #:use-module (guix build-system python)) + #:use-module (guix build-system python) + #:use-module (guix gexp)) (define-public python-scipy (package @@ -1291,3 +1293,64 @@ (define-public python-aplus (description "This package is an implementation of the Promises/A+ specification and test suite in Python.") (license license:expat))) + +(define-public python-edflib + (package + (name "python-edflib") + (version "1.0.6") + (source + (origin + (method git-fetch) + (uri (git-reference + (url "https://gitlab.com/Teuniz/EDFlib-Python.git") + (commit "417fc8cc7c47a9b0e39189b34de1fc50be65b72d"))) + (file-name (git-file-name name version)) + (sha256 + (base32 + "0h3v5kb4yn1ahb7gxb8qrh1m50w1ykb4px4yvvq64kbckn0qrd22")))) + (build-system python-build-system) + (arguments + (list + #:phases + #~(modify-phases %standard-phases + (add-after 'unpack 'fix-tests + (lambda _ + (substitute* "tests/edf_unit_test.py" + (("from edfreader") "from EDFlib.edfreader") + (("from edfwriter") "from EDFlib.edfwriter")))) + ;; XXX: PEP 517 manual build copied from python-isort. + (replace 'build + (lambda _ + (setenv "SOURCE_DATE_EPOCH" "315532800") + (invoke "python" + "-m" + "build" + "--wheel" + "--no-isolation" + "."))) + (replace 'install + (lambda _ + (let ((whl (car (find-files "dist" "\\.whl$")))) + (invoke "pip" + "--no-cache-dir" + "--no-input" + "install" + "--no-deps" + "--prefix" + #$output + whl)))) + (replace 'check + (lambda* (#:key tests? #:allow-other-keys) + (when tests? + (invoke "python" "tests/edf_unit_test.py"))))))) + (propagated-inputs (list python-numpy python-pypa-build)) + (home-page "https://www.teuniz.net/edflib_python/") + (synopsis "Read and write EDF+/BDF+ files") + (description + "EDFlib for Python is a programming library to read and write EDF+ and +BDF+ files. It also reads old-type EDF/BDF files. @dfn{EDF} means +@url{https://www.teuniz.net/edfbrowser/edf%20format%20description.html, +European Data Format}. @dfn{BDF} is the +@url{https://www.teuniz.net/edfbrowser/bdfplus%20format%20description.html, +24-bit version} of EDF.") + (license license:bsd-3))) -- 2.36.1