1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build
8 meson,
9 meson-python,
10 ninja,
11 pybind11,
12
13 # propagates
14 numpy,
15
16 # optionals
17 bokeh,
18 chromedriver,
19 selenium,
20
21 # tests
22 matplotlib,
23 pillow,
24 pytestCheckHook,
25}:
26
27let
28 contourpy = buildPythonPackage rec {
29 pname = "contourpy";
30 version = "1.2.1";
31 format = "pyproject";
32
33 disabled = pythonOlder "3.8";
34
35 src = fetchFromGitHub {
36 owner = "contourpy";
37 repo = "contourpy";
38 rev = "refs/tags/v${version}";
39 hash = "sha256-Qd6FC7SgFyC/BvOPWVkr2ZfKVMVAknLlidNRq3zcWU0=";
40 };
41
42 nativeBuildInputs = [
43 meson
44 meson-python
45 ninja
46 pybind11
47 ];
48
49 propagatedBuildInputs = [ numpy ];
50
51 passthru.optional-depdendencies = {
52 bokeh = [
53 bokeh
54 chromedriver
55 selenium
56 ];
57 };
58
59 doCheck = false; # infinite recursion with matplotlib, tests in passthru
60
61 nativeCheckInputs = [
62 matplotlib
63 pillow
64 pytestCheckHook
65 ];
66
67 passthru.tests = {
68 check = contourpy.overridePythonAttrs (_: {
69 doCheck = true;
70 });
71 };
72
73 pythonImportsCheck = [ "contourpy" ];
74
75 meta = with lib; {
76 changelog = "https://github.com/contourpy/contourpy/releases/tag/v${version}";
77 description = "Python library for calculating contours in 2D quadrilateral grids";
78 homepage = "https://github.com/contourpy/contourpy";
79 license = licenses.bsd3;
80 maintainers = [ ];
81 };
82 };
83in
84contourpy