unofficial mirror of guix-science@gnu.org 
 help / color / mirror / Atom feed
From: Ricardo Wurmus <rekado@elephly.net>
To: Alexis Simon via Guix-Science <guix-science@gnu.org>
Cc: Simon Tournier <zimon.toutoune@gmail.com>,
	 help-guix <help-guix@gnu.org>,
	 Alexis Simon <alexis.simon@runbox.com>
Subject: Re: packaging python-cyvcf2
Date: Thu, 18 Apr 2024 11:13:10 +0200	[thread overview]
Message-ID: <877cgv3uft.fsf@elephly.net> (raw)
In-Reply-To: <7b845ef7-f15e-45b9-9a31-e645ce736ec4@runbox.com> (Alexis Simon via Guix-Science's message of "Fri, 22 Mar 2024 12:38:41 -0700")

[-- Attachment #1: Type: text/plain, Size: 525 bytes --]

Hi,

> I've abandoned running the tests though, I'm hitting a module not
> found error. pytest doesn't manage to load the just built module,
> probably an issue with the paths.

It's an actual problem with the build.  You need to build the cython
extension first.  I've attached the working package definition.

I'd like to add this to gnu/packages/bioinformatics.scm.  I'd like to
set authorship of the commit to you.  Is the name and email address I
used for attribution correct?  (See the attached commit.)

-- 
Ricardo



[-- Attachment #2: 0001-gnu-Add-python-cyvcf2.patch --]
[-- Type: text/x-patch, Size: 5374 bytes --]

From 12af58e7f29c5a96888ecba7d264669940f1f259 Mon Sep 17 00:00:00 2001
Message-ID: <12af58e7f29c5a96888ecba7d264669940f1f259.1713431532.git.rekado@elephly.net>
From: Alexis Simon <alexis.simon@runbox.com>
Date: Thu, 18 Apr 2024 11:10:22 +0200
Subject: [PATCH] gnu: Add python-cyvcf2.

* gnu/packages/bioinformatics.scm (python-cyvcf2): New variable.

Co-authored-by: Ricardo Wurmus <rekado@elephly.net>
Change-Id: I0db07e7b5840f5c1f5c68512ffabb3d6b39ab95c
---
 gnu/packages/bioinformatics.scm | 53 +++++++++++++++++++++++++++++++++
 1 file changed, 53 insertions(+)

diff --git a/gnu/packages/bioinformatics.scm b/gnu/packages/bioinformatics.scm
index 448ea5d6de..d2e0656435 100644
--- a/gnu/packages/bioinformatics.scm
+++ b/gnu/packages/bioinformatics.scm
@@ -25,6 +25,7 @@
 ;;; Copyright © 2021 Felix Gruber <felgru@posteo.net>
 ;;; Copyright © 2022, 2023 Navid Afkhami <navid.afkhami@mdc-berlin.de>
 ;;; Copyright © 2022 Antero Mejr <antero@mailbox.org>
+;;; Copyright © 2024 Alexis Simon <alexis.simon@runbox.com>
 ;;;
 ;;; This file is part of GNU Guix.
 ;;;
@@ -1916,6 +1917,58 @@ (define-public python-cmseq
 and sequence consensus.")
     (license license:expat)))
 
+(define-public python-cyvcf2
+  (package
+    (name "python-cyvcf2")
+    (version "0.30.28")
+    (source
+     (origin
+       (method git-fetch)
+       (uri (git-reference
+             (url "https://github.com/brentp/cyvcf2")
+             (commit (string-append "v" version))))
+       (file-name (git-file-name name version))
+       (sha256
+        (base32 "16yhfax509zyip8kkq2b0lflx5bdq5why7d785ayrqyzzq2rxqkk"))
+       (modules '((guix build utils)))
+       (snippet
+        ;; Delete bundled library
+        '(delete-file-recursively "htslib"))))
+    (build-system pyproject-build-system)
+    (arguments
+     (list
+      #:phases
+      #~(modify-phases %standard-phases
+          (add-before 'check 'build-extensions
+            (lambda _
+              ;; Cython extensions have to be built before running the tests.
+              (invoke "python" "setup.py" "build_ext" "--inplace")))
+          (add-after 'unpack 'fix-setup
+            (lambda* (#:key inputs #:allow-other-keys)
+              (substitute* "setup.py"
+                (("^htslib_include_dirs =.*")
+                 (string-append "htslib_include_dirs = [\""
+                                #$(this-package-input "htslib") "/include\"]\n"))
+                (("lib_name = \"libhts.so\"")
+                 (string-append "lib_name = \""
+                                (search-input-file inputs "lib/libhts.so.3")
+                                "\"\n")))))
+          (add-before 'build 'use-system-htslib-package
+            (lambda _
+              (setenv "CYTHONIZE" "1")
+              (setenv "CYVCF2_HTSLIB_MODE" "EXTERNAL"))))))
+    (inputs (list curl htslib libdeflate openssl zlib))
+    (native-inputs (list python-cython python-pytest))
+    (propagated-inputs
+     (list python-click
+           python-coloredlogs
+           python-numpy))
+    (home-page "https://github.com/brentp/cyvcf2/")
+    (synopsis "Fast vcf file parsing with Cython and htslib")
+    (description "Cyvcf2 is a Cython wrapper around htslib built for fast
+parsing of Variant Call Format (VCF) files.")
+    (license license:expat)))
+
 (define-public python-decoupler-py
   ;; This latest commit fixes a bug in test_omnip.py.
   (let ((commit "459b235348ddd9135217a3722d9dd1caa9a14ace")

base-commit: 7bed290fdfd830d690daf065de6d2ecab73309d9
prerequisite-patch-id: 5da8ef187becff2c53ea5f2031e8825db623eb65
prerequisite-patch-id: 13be25d244e0bf4742f2713c79b657a10206fd4a
prerequisite-patch-id: 5eac5ecb9efd0643ee72851a87db05636faadb22
prerequisite-patch-id: c991e73ae60aab13d5b364946213cd75acff1787
prerequisite-patch-id: 88eb87c18d5e09956462a19515d2efb22d508cb4
prerequisite-patch-id: 6af49e118b9dbcc75d410d97c1a6f6e13d81bafe
prerequisite-patch-id: 5444dc17e9de17cdd39e24c969589e5a94488076
prerequisite-patch-id: b3e368fe34327e828bc15d07383f9adf2e54102a
prerequisite-patch-id: 1cbd95e12fd254f4d301786938e3734106949d1e
prerequisite-patch-id: fc39a6a4a400c1d4b094cd1d3029ecfbe2f70e6d
prerequisite-patch-id: 02cc7b0f2140f6342ed1d32a1f09cd7b2e61d2dd
prerequisite-patch-id: b0c59b60fcda7ce3c4b76a2f679db0403ac4b1a5
prerequisite-patch-id: 2104d5a932eeb3def4e438643469c97f8d5703ac
prerequisite-patch-id: 98982539329a10f4947ae1e412b9543ad15fdc3d
prerequisite-patch-id: 577d37113f5124f1bfc50df84021190ed7d75edf
prerequisite-patch-id: e049fd1dac3aac5fc727237642b6d385fd6bf33f
prerequisite-patch-id: 98608c3b9c9f927167b0aad70567e6ee42fef7e5
prerequisite-patch-id: 4627ef56075e71c4eeb975c4a26ee1e749ee69b0
prerequisite-patch-id: e43d1ce95f721374308a3f05dc436e801e96cf37
prerequisite-patch-id: 51c0cfd16f8214e059d05a8576842f902fced7c4
prerequisite-patch-id: 5bb19f2748c376544fc69aafb74e2c5f192e5426
prerequisite-patch-id: 894cce561d9bdddf0c81d80b419544cdd2d8142b
prerequisite-patch-id: aeca519cc08fb04843001e32fa8b69eb2b082548
prerequisite-patch-id: 5e9a637f0716105f3d00d44d1d8c24436f5cbb4f
prerequisite-patch-id: e5bf09d839ad19c3d13a81f3a26751663f8766c0
prerequisite-patch-id: eb002e03793d80ee3e13a6f03340bd107ec3a3ea
prerequisite-patch-id: d9c2389f4ec6e9899d5456853cb40fa2be1cc22d
-- 
2.41.0


  parent reply	other threads:[~2024-04-18  9:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-22  1:03 packaging python-cyvcf2 Alexis Simon
2024-03-22  1:03 ` Alexis Simon via Guix-Science
2024-03-22 15:25 ` Simon Tournier
2024-03-22 19:38   ` Alexis Simon
2024-03-22 19:38     ` Alexis Simon via Guix-Science
2024-03-26 15:47     ` Simon Tournier
2024-04-18  9:13     ` Ricardo Wurmus [this message]
2024-04-21  1:31       ` Alexis Simon via Guix-Science

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://guix.gnu.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=877cgv3uft.fsf@elephly.net \
    --to=rekado@elephly.net \
    --cc=alexis.simon@runbox.com \
    --cc=guix-science@gnu.org \
    --cc=help-guix@gnu.org \
    --cc=zimon.toutoune@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).