saunafs: 4.6.0 -> 4.7.0 (#379649)
[NixPkgs.git] / pkgs / development / python-modules / msprime / default.nix
blobc0cd877ccaaa8db295b95ceea766bc13da0a1320
2   lib,
3   buildPythonPackage,
4   demes,
5   fetchPypi,
6   gsl,
7   newick,
8   numpy,
9   oldest-supported-numpy,
10   pytest-xdist,
11   pytestCheckHook,
12   pythonOlder,
13   scipy,
14   setuptools-scm,
15   tskit,
16   wheel,
19 buildPythonPackage rec {
20   pname = "msprime";
21   version = "1.3.3";
22   pyproject = true;
24   disabled = pythonOlder "3.8";
26   src = fetchPypi {
27     inherit pname version;
28     hash = "sha256-2K55gHYWf2Mrj9fszVCJ+qqEyQNMppQi+IZCX5SlsBs=";
29   };
31   postPatch = ''
32     # build-time constriant, used to ensure forward and backward compat
33     substituteInPlace pyproject.toml \
34       --replace-fail "numpy>=2" "numpy"
35   '';
37   nativeBuildInputs = [
38     gsl
39     oldest-supported-numpy
40     setuptools-scm
41     wheel
42   ];
44   buildInputs = [ gsl ];
46   propagatedBuildInputs = [
47     numpy
48     newick
49     tskit
50     demes
51   ];
53   nativeCheckInputs = [
54     pytestCheckHook
55     pytest-xdist
56     scipy
57   ];
59   disabledTests = [
60     "tests/test_ancestry.py::TestSimulator::test_debug_logging"
61     "tests/test_ancestry.py::TestSimulator::test_debug_logging_dtw"
62   ];
64   disabledTestPaths = [
65     "tests/test_demography.py"
66     "tests/test_algorithms.py"
67     "tests/test_provenance.py"
68     "tests/test_dict_encoding.py"
69   ];
71   # `python -m pytest` puts $PWD in sys.path, which causes the extension
72   # modules imported as `msprime._msprime` to be unavailable, failing the
73   # tests. This deletes the `msprime` folder such that only what's installed in
74   # $out is used for the imports. See also discussion at:
75   # https://github.com/NixOS/nixpkgs/issues/255262
76   preCheck = ''
77     rm -r msprime
78   '';
79   pythonImportsCheck = [ "msprime" ];
81   meta = with lib; {
82     description = "Simulate genealogical trees and genomic sequence data using population genetic models";
83     homepage = "https://github.com/tskit-dev/msprime";
84     changelog = "https://github.com/tskit-dev/msprime/blob/${version}/CHANGELOG.md";
85     license = licenses.gpl3Plus;
86     maintainers = with maintainers; [ alxsimon ];
87   };