1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 fetchPypi,
6 setuptools-scm,
7 demes,
8 matplotlib,
9 numpy,
10 scipy,
11 pythonOlder,
12 pytestCheckHook,
13 pytest-cov-stub,
14 pytest-xdist,
15 mpmath,
16}:
17
18buildPythonPackage rec {
19 pname = "demesdraw";
20 version = "0.4.0";
21 format = "pyproject";
22 disabled = pythonOlder "3.7";
23
24 src = fetchPypi {
25 inherit pname version;
26 hash = "sha256-n7dz+kYf2yyr66TBx452W6z4qT6bT81u0J4aMAYuGCc=";
27 };
28
29 nativeBuildInputs = [ setuptools-scm ];
30
31 propagatedBuildInputs = [
32 demes
33 matplotlib
34 numpy
35 scipy
36 ];
37
38 # This variable is needed to suppress the "Trace/BPT trap: 5" error in Darwin's checkPhase.
39 # Not sure of the details, but we can avoid it by changing the matplotlib backend during testing.
40 env.MPLBACKEND = lib.optionalString stdenv.hostPlatform.isDarwin "Agg";
41
42 nativeCheckInputs = [
43 pytestCheckHook
44 pytest-cov-stub
45 pytest-xdist
46 mpmath
47 ];
48
49 pythonImportsCheck = [ "demesdraw" ];
50
51 meta = with lib; {
52 description = "Drawing functions for Demes demographic models";
53 mainProgram = "demesdraw";
54 homepage = "https://github.com/grahamgower/demesdraw";
55 license = licenses.isc;
56 maintainers = with maintainers; [ ];
57 };
58}