summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/bx-python/default.nix
blob: fce67e6cffba3222ff9d8fd09814f2605daf0115 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
{
  lib,
  fetchFromGitHub,
  buildPythonPackage,
  numpy,
  pyparsing,
  cython,
  zlib,
  python-lzo,
  pytestCheckHook,
  setuptools,
  oldest-supported-numpy,
}:

buildPythonPackage rec {
  pname = "bx-python";
  version = "0.14.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "bxlab";
    repo = "bx-python";
    tag = "v${version}";
    hash = "sha256-WZjCPggAlC+L/SagC4TXJXNrFG85BmjO7FaV2GxrYYA=";
  };

  postPatch = ''
    # pytest-cython, which provides this option, isn't packaged
    substituteInPlace pytest.ini \
      --replace-fail "--doctest-cython" ""
  '';

  build-system = [
    setuptools
    cython
    oldest-supported-numpy
  ];

  buildInputs = [ zlib ];

  dependencies = [
    numpy
    pyparsing
  ];

  nativeCheckInputs = [
    python-lzo
    pytestCheckHook
  ];

  # https://github.com/bxlab/bx-python/issues/101
  doCheck = false;

  postInstall = ''
    cp -r scripts/* $out/bin

    # This is a small hack; the test suite uses the scripts which need to
    # be patched. Linking the patched scripts in $out back to the
    # working directory allows the tests to run
    rm -rf scripts
    ln -s $out/bin scripts
  '';

  meta = {
    description = "Tools for manipulating biological data, particularly multiple sequence alignments";
    homepage = "https://github.com/bxlab/bx-python";
    changelog = "https://github.com/bxlab/bx-python/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ jbedo ];
    platforms = [ "x86_64-linux" ];
  };
}