gnu: python-pybedtools: Update to 0.12.0.

* gnu/packages/bioinformatics.scm (python-pybedtools): Update to 0.12.0.
Use G-Expresions.
[source] <snippet>: Move phase {remove-cython-generated-files} here.
[argumets] <modules>: Drop all.
<build-backend>: Use setuptools.build_meta.
<test-flags>: Run test from installed module via "--pyargs".
<phases>: Remove 'build-extenstions; add 'remove-local-source.
[native-inputs]: Remove python-wheel.

Change-Id: I993aaee8a4bae900d4c6b61d5b4804d8afbe1131
This commit is contained in:
Sharlatan Hellseher 2026-01-18 22:25:56 +00:00
parent e2a9025077
commit c994d6420e
No known key found for this signature in database
GPG key ID: 76D727BFF62CD2B5

View file

@ -3613,63 +3613,64 @@ phylogenetic markers, and can also scale to very large phylogenies comprising
(define-public python-pybedtools
(package
(name "python-pybedtools")
(version "0.10.0")
(source (origin
(method url-fetch)
(uri (pypi-uri "pybedtools" version))
(sha256
(base32
"0q8if5bd8zgv5xvr5zs4pj8y60yzl8i5jz8xfk6bw4xh4fnvlvqs"))))
(version "0.12.0")
(source
(origin
(method url-fetch)
(uri (pypi-uri "pybedtools" version))
(sha256
(base32 "0jbjaj0n34k64jp5q3l653qrrxwd8d276hqbq1ii7j3rcngyr1l7"))
(snippet
;; Force the Cythonization of C++ files to guard against compilation
;; problems.
#~(begin
(use-modules (guix build utils))
(use-modules (srfi srfi-26))
(let ((cython-sources (map (cut string-drop-right <> 4)
(find-files "." "\\.pyx$")))
(c/c++-files (find-files "." "\\.(c|cpp|cxx)$")))
(define (strip-extension filename)
(string-take filename (string-index-right filename #\.)))
(define (cythonized? c/c++-file)
(member (strip-extension c/c++-file) cython-sources))
(for-each delete-file (filter cythonized? c/c++-files)))))))
(build-system pyproject-build-system)
(arguments
(list
#:modules '((srfi srfi-26)
(guix build utils)
(guix build python-build-system)
(guix build pyproject-build-system))
#:build-backend "setuptools.build_meta"
;; tests: 508 passed, 1 deselected, 3 xfailed
#:test-flags
;; Requires internet access.
'(list "-k" "not test_chromsizes")
#~(list "--pyargs" "pybedtools"
;; ValueError: It appears you don't have an internet connection
;; -- unable to get chromsizes from UCSC
"--deselect=test/test_helpers.py::test_chromsizes")
#:phases
'(modify-phases %standard-phases
(add-after 'unpack 'fix-references
(lambda _
(substitute* "pybedtools/test/test_issues.py"
(("'/bin/bash'") (string-append "'" (which "bash") "'")))))
;; Force the Cythonization of C++ files to guard against compilation
;; problems.
(add-after 'unpack 'remove-cython-generated-files
(lambda _
(let ((cython-sources (map (cut string-drop-right <> 4)
(find-files "." "\\.pyx$")))
(c/c++-files (find-files "." "\\.(c|cpp|cxx)$")))
(define (strip-extension filename)
(string-take filename (string-index-right filename #\.)))
(define (cythonized? c/c++-file)
(member (strip-extension c/c++-file) cython-sources))
(for-each delete-file (filter cythonized? c/c++-files)))))
(add-after 'remove-cython-generated-files 'generate-cython-extensions
(lambda _
(invoke "python" "setup.py" "cythonize")))
(add-before 'check 'build-extensions
(lambda _
;; Cython extensions have to be built before running the tests.
(invoke "python" "setup.py" "build_ext" "--inplace"))))))
#~(modify-phases %standard-phases
(add-after 'unpack 'fix-references
(lambda _
(substitute* "pybedtools/test/test_issues.py"
(("'/bin/bash'") (string-append "'" (which "bash") "'")))))
(add-before 'build 'generate-cython-extensions
(lambda _
(invoke "python" "setup.py" "cythonize")))
(add-before 'check 'remove-local-source
(lambda _
(delete-file-recursively "pybedtools"))))))
(propagated-inputs
(list bedtools samtools
(list bedtools
kentutils ;for bedGraphToBigWig
python-numpy
python-pandas
python-psutil
python-pysam
python-pyyaml))
python-pyyaml
samtools))
(inputs
(list zlib))
(native-inputs
(list python-cython
python-pytest
python-setuptools
python-wheel))
python-setuptools))
(home-page "https://pythonhosted.org/pybedtools/")
(synopsis "Python wrapper for BEDtools programs")
(description