1{ lib
2, buildPythonPackage
3, fetchPypi
4, oldest-supported-numpy
5, setuptools-scm
6, wheel
7, pythonOlder
8, gsl
9, numpy
10, newick
11, tskit
12, demes
13, pytestCheckHook
14, pytest-xdist
15, scipy
16}:
17
18buildPythonPackage rec {
19 pname = "msprime";
20 version = "1.2.0";
21 format = "pyproject";
22 disabled = pythonOlder "3.8";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-YAJa2f0w2CenKubnYLbP8HodDhabLB2hAkyw/CPkp6o=";
27 };
28
29 nativeBuildInputs = [
30 gsl
31 oldest-supported-numpy
32 setuptools-scm
33 wheel
34 ];
35
36 buildInputs = [
37 gsl
38 ];
39
40 propagatedBuildInputs = [
41 numpy
42 newick
43 tskit
44 demes
45 ];
46
47 nativeCheckInputs = [
48 pytestCheckHook
49 pytest-xdist
50 scipy
51 ];
52 disabledTests = [
53 "tests/test_ancestry.py::TestSimulator::test_debug_logging"
54 "tests/test_ancestry.py::TestSimulator::test_debug_logging_dtw"
55 ];
56 disabledTestPaths = [
57 "tests/test_demography.py"
58 "tests/test_algorithms.py"
59 "tests/test_provenance.py"
60 "tests/test_dict_encoding.py"
61 ];
62
63 # `python -m pytest` puts $PWD in sys.path, which causes the extension
64 # modules imported as `msprime._msprime` to be unavailable, failing the
65 # tests. This deletes the `msprime` folder such that only what's installed in
66 # $out is used for the imports. See also discussion at:
67 # https://github.com/NixOS/nixpkgs/issues/255262
68 preCheck = ''
69 rm -r msprime
70 '';
71 pythonImportsCheck = [
72 "msprime"
73 ];
74
75 meta = with lib; {
76 description = "Simulate genealogical trees and genomic sequence data using population genetic models";
77 homepage = "https://github.com/tskit-dev/msprime";
78 license = licenses.gpl3Plus;
79 maintainers = with maintainers; [ alxsimon ];
80 };
81}