nixpkgs/pkgs/development/python-modules/msprime/default.nix
Doron Behar 942d0482e3 python3.pkgs.msprime: use pytestCheckHook
Instead of manually specifying the disabled tests and test paths in
`checkPhase`, use the pytestCheckHook for that, and avoid the issue
described at https://github.com/NixOS/nixpkgs/issues/255262 by removing
the source directory.
2023-09-16 16:12:39 +03:00

82 lines
1.7 KiB
Nix

{ lib
, buildPythonPackage
, fetchPypi
, oldest-supported-numpy
, setuptools-scm
, wheel
, pythonOlder
, gsl
, numpy
, newick
, tskit
, demes
, pytestCheckHook
, pytest-xdist
, scipy
}:
buildPythonPackage rec {
pname = "msprime";
version = "1.2.0";
format = "pyproject";
disabled = pythonOlder "3.8";
src = fetchPypi {
inherit pname version;
hash = "sha256-YAJa2f0w2CenKubnYLbP8HodDhabLB2hAkyw/CPkp6o=";
};
nativeBuildInputs = [
gsl
oldest-supported-numpy
setuptools-scm
wheel
];
buildInputs = [
gsl
];
propagatedBuildInputs = [
numpy
newick
tskit
demes
];
nativeCheckInputs = [
pytestCheckHook
pytest-xdist
scipy
];
disabledTests = [
"tests/test_ancestry.py::TestSimulator::test_debug_logging"
"tests/test_ancestry.py::TestSimulator::test_debug_logging_dtw"
];
disabledTestPaths = [
"tests/test_demography.py"
"tests/test_algorithms.py"
"tests/test_provenance.py"
"tests/test_dict_encoding.py"
];
# `python -m pytest` puts $PWD in sys.path, which causes the extension
# modules imported as `msprime._msprime` to be unavailable, failing the
# tests. This deletes the `msprime` folder such that only what's installed in
# $out is used for the imports. See also discussion at:
# https://github.com/NixOS/nixpkgs/issues/255262
preCheck = ''
rm -r msprime
'';
pythonImportsCheck = [
"msprime"
];
meta = with lib; {
description = "Simulate genealogical trees and genomic sequence data using population genetic models";
homepage = "https://github.com/tskit-dev/msprime";
license = licenses.gpl3Plus;
maintainers = with maintainers; [ alxsimon ];
};
}