[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
02/14: gnu: khmer: Cythonize source files.
From: |
guix-commits |
Subject: |
02/14: gnu: khmer: Cythonize source files. |
Date: |
Wed, 8 Dec 2021 08:33:39 -0500 (EST) |
rekado pushed a commit to branch core-updates-frozen
in repository guix.
commit 298a8d0b89bb44ccb6b7058ded17a55ae831c96a
Author: Ricardo Wurmus <rekado@elephly.net>
AuthorDate: Wed Dec 8 12:00:48 2021 +0100
gnu: khmer: Cythonize source files.
* gnu/packages/bioinformatics.scm (khmer)[source]: Remove generated files.
[arguments]: Add phase 'do-use-cython to patch the setup.py to generate cpp
files from Cython sources; add 'build-extensions phase; replace 'check
phase.
---
gnu/packages/bioinformatics.scm | 29 +++++++++++++++++++++--------
1 file changed, 21 insertions(+), 8 deletions(-)
diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 741e632..d8fb302 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -5082,7 +5082,9 @@ command, or queried for specific k-mers with
@code{jellyfish query}.")
(("# libraries = z,bz2")
"libraries = z,bz2")
(("include:third-party/zlib:third-party/bzip2")
- "include:"))))))
+ "include:"))
+ ;; Delete generated Cython CPP files.
+ (for-each delete-file (find-files "khmer/_oxli/" "\\.cpp$"))))))
(build-system python-build-system)
(arguments
`(#:phases
@@ -5095,13 +5097,24 @@ command, or queried for specific k-mers with
@code{jellyfish query}.")
(substitute* "sandbox/sweep-reads.py"
(("time\\.clock")
"time.process_time"))))
- (add-before 'reset-gzip-timestamps 'make-files-writable
- (lambda* (#:key outputs #:allow-other-keys)
- ;; Make sure .gz files are writable so that the
- ;; 'reset-gzip-timestamps' phase can do its work.
- (let ((out (assoc-ref outputs "out")))
- (for-each make-file-writable
- (find-files out "\\.gz$"))))))))
+ (add-after 'unpack 'do-use-cython
+ (lambda _
+ (substitute* "setup.py"
+ (("from setuptools import Extension as CyExtension")
+ "from Cython.Distutils import Extension as CyExtension")
+ (("from setuptools.command.build_ext import build_ext as
_build_ext")
+ "from Cython.Distutils import build_ext as _build_ext")
+ (("HAS_CYTHON = False") "HAS_CYTHON = True")
+ (("cy_ext = 'cpp'") "cy_ext = 'pyx'"))))
+ (add-before 'build 'build-extensions
+ (lambda _
+ ;; Cython extensions have to be built before running the tests.
+ (invoke "python" "setup.py" "build_ext" "--inplace")))
+ (replace 'check
+ (lambda* (#:key tests? inputs outputs #:allow-other-keys)
+ (when tests?
+ (add-installed-pythonpath inputs outputs)
+ (invoke "pytest" "-v")))))))
(native-inputs
`(("python-cython" ,python-cython)
("python-pytest" ,python-pytest)
- branch core-updates-frozen updated (ee03b51 -> c806005), guix-commits, 2021/12/08
- 04/14: gnu: snap-aligner: Remove trailing #T., guix-commits, 2021/12/08
- 02/14: gnu: khmer: Cythonize source files.,
guix-commits <=
- 05/14: gnu: snap-aligner: Update to 2.0.0., guix-commits, 2021/12/08
- 06/14: gnu: imp: Disable tests., guix-commits, 2021/12/08
- 01/14: gnu: cwltool: Update to 3.1.20211107152837., guix-commits, 2021/12/08
- 08/14: gnu: tbsp: Update to 1.0.0-2.dc30c03., guix-commits, 2021/12/08
- 03/14: gnu: snap-aligner: Run tests conditionally., guix-commits, 2021/12/08
- 07/14: gnu: mantis: Update to 0.1-2.b6979a2., guix-commits, 2021/12/08
- 09/14: gnu: discrover: Remove trailing #T., guix-commits, 2021/12/08
- 10/14: gnu: discrover: Add texlive-fonts-ec to inputs., guix-commits, 2021/12/08
- 14/14: gnu: ocaml-mcl: Add -fcommon to compiler flags., guix-commits, 2021/12/08
- 12/14: gnu: paml: Remove trailing #T., guix-commits, 2021/12/08