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