1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 numpy,
6 pyparsing,
7 cython,
8 zlib,
9 python-lzo,
10 pytestCheckHook,
11 setuptools,
12 oldest-supported-numpy,
13}:
14
15buildPythonPackage rec {
16 pname = "bx-python";
17 version = "0.14.0";
18 pyproject = true;
19
20 src = fetchFromGitHub {
21 owner = "bxlab";
22 repo = "bx-python";
23 tag = "v${version}";
24 hash = "sha256-WZjCPggAlC+L/SagC4TXJXNrFG85BmjO7FaV2GxrYYA=";
25 };
26
27 postPatch = ''
28 # pytest-cython, which provides this option, isn't packaged
29 substituteInPlace pytest.ini \
30 --replace-fail "--doctest-cython" ""
31 '';
32
33 build-system = [
34 setuptools
35 cython
36 oldest-supported-numpy
37 ];
38
39 buildInputs = [ zlib ];
40
41 dependencies = [
42 numpy
43 pyparsing
44 ];
45
46 nativeCheckInputs = [
47 python-lzo
48 pytestCheckHook
49 ];
50
51 # https://github.com/bxlab/bx-python/issues/101
52 doCheck = false;
53
54 postInstall = ''
55 cp -r scripts/* $out/bin
56
57 # This is a small hack; the test suite uses the scripts which need to
58 # be patched. Linking the patched scripts in $out back to the
59 # working directory allows the tests to run
60 rm -rf scripts
61 ln -s $out/bin scripts
62 '';
63
64 meta = {
65 description = "Tools for manipulating biological data, particularly multiple sequence alignments";
66 homepage = "https://github.com/bxlab/bx-python";
67 changelog = "https://github.com/bxlab/bx-python/releases/tag/${src.tag}";
68 license = lib.licenses.mit;
69 maintainers = with lib.maintainers; [ jbedo ];
70 platforms = [ "x86_64-linux" ];
71 };
72}