2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchPypi,
|
|
|
|
setuptools-scm,
|
|
|
|
demes,
|
|
|
|
matplotlib,
|
|
|
|
numpy,
|
|
|
|
scipy,
|
|
|
|
pythonOlder,
|
|
|
|
pytestCheckHook,
|
|
|
|
pytest-xdist,
|
|
|
|
mpmath,
|
2023-07-15 17:15:38 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "demesdraw";
|
|
|
|
version = "0.4.0";
|
|
|
|
format = "pyproject";
|
|
|
|
disabled = pythonOlder "3.7";
|
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
|
|
|
hash = "sha256-n7dz+kYf2yyr66TBx452W6z4qT6bT81u0J4aMAYuGCc=";
|
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ setuptools-scm ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
demes
|
|
|
|
matplotlib
|
|
|
|
numpy
|
|
|
|
scipy
|
|
|
|
];
|
|
|
|
|
|
|
|
postPatch = ''
|
|
|
|
# remove coverage arguments to pytest
|
|
|
|
sed -i '/--cov/d' setup.cfg
|
|
|
|
'';
|
|
|
|
|
|
|
|
# This variable is needed to suppress the "Trace/BPT trap: 5" error in Darwin's checkPhase.
|
|
|
|
# Not sure of the details, but we can avoid it by changing the matplotlib backend during testing.
|
|
|
|
env.MPLBACKEND = lib.optionalString stdenv.isDarwin "Agg";
|
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-xdist
|
|
|
|
mpmath
|
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "demesdraw" ];
|
2023-07-15 17:15:38 +00:00
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Drawing functions for Demes demographic models";
|
2024-04-21 15:54:59 +00:00
|
|
|
mainProgram = "demesdraw";
|
2023-07-15 17:15:38 +00:00
|
|
|
homepage = "https://github.com/grahamgower/demesdraw";
|
|
|
|
license = licenses.isc;
|
|
|
|
maintainers = with maintainers; [ alxsimon ];
|
|
|
|
};
|
|
|
|
}
|