at 25.11-pre 1.8 kB view raw
1{ 2 lib, 3 buildPythonPackage, 4 fetchFromGitHub, 5 bzip2, 6 bcftools, 7 curl, 8 cython, 9 htslib, 10 libdeflate, 11 xz, 12 pytestCheckHook, 13 setuptools, 14 samtools, 15 zlib, 16}: 17 18buildPythonPackage { 19 pname = "pysam"; 20 version = "0.22.1-unstable-2024-10-30"; 21 pyproject = true; 22 23 # Fetching from GitHub instead of PyPi cause the 0.13 src release on PyPi is 24 # missing some files which cause test failures. 25 # Tracked at: https://github.com/pysam-developers/pysam/issues/616 26 src = fetchFromGitHub { 27 owner = "pysam-developers"; 28 repo = "pysam"; 29 rev = "0eae5be21ac3ab3ac7aa770a3931e2977e37b909"; 30 hash = "sha256-i8glYSpuCRNhNtK4i6eUrerz8daiMfY/YgDwgSuELbc="; 31 }; 32 33 nativeBuildInputs = [ 34 cython 35 samtools 36 setuptools 37 ]; 38 39 buildInputs = [ 40 bzip2 41 curl 42 libdeflate 43 xz 44 zlib 45 ]; 46 47 # Use nixpkgs' htslib instead of the bundled one 48 # See https://pysam.readthedocs.io/en/latest/installation.html#external 49 # NOTE that htslib should be version compatible with pysam 50 preBuild = '' 51 export HTSLIB_MODE=shared 52 export HTSLIB_LIBRARY_DIR=${htslib}/lib 53 export HTSLIB_INCLUDE_DIR=${htslib}/include 54 ''; 55 56 nativeCheckInputs = [ 57 pytestCheckHook 58 bcftools 59 htslib 60 ]; 61 62 preCheck = '' 63 export HOME=$TMPDIR 64 make -C tests/pysam_data 65 make -C tests/cbcf_data 66 make -C tests/tabix_data 67 rm -rf pysam 68 ''; 69 70 pythonImportsCheck = [ 71 "pysam" 72 "pysam.bcftools" 73 "pysam.libchtslib" 74 "pysam.libcutils" 75 "pysam.libcvcf" 76 ]; 77 78 meta = { 79 description = "Python module for reading, manipulating and writing genome data sets"; 80 downloadPage = "https://github.com/pysam-developers/pysam"; 81 homepage = "https://pysam.readthedocs.io"; 82 maintainers = with lib.maintainers; [ unode ]; 83 license = lib.licenses.mit; 84 platforms = lib.platforms.unix; 85 }; 86}