summary refs log tree commit diff
path: root/pkgs/development/python-modules/plotnine/default.nix
blob: e6cb98a305422dc2db42b4a80c397eff16d68c07 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
{ lib
, adjusttext
, buildPythonPackage
, fetchPypi
, geopandas
, matplotlib
, mizani
, pandas
, patsy
, pytestCheckHook
, pythonOlder
, scikit-misc
, scipy
, setuptools-scm
, statsmodels
}:

buildPythonPackage rec {
  pname = "plotnine";
  version = "0.10.1";
  format = "pyproject";

  disabled = pythonOlder "3.8";

  src = fetchPypi {
    inherit pname version;
    hash = "sha256-2RKgS2ONz4IsUaZ4i4VmQjI0jVFfFR2zpkwAAZZvaEE=";
  };

  nativeBuildInputs = [
    setuptools-scm
  ];

  postPatch = ''
    substituteInPlace pyproject.toml \
      --replace " --cov=plotnine --cov-report=xml" ""
  '';

  buildInputs = [
    matplotlib
    mizani
    pandas
    patsy
    scipy
    statsmodels
  ];

  checkInputs = [
    adjusttext
    geopandas
    pytestCheckHook
    scikit-misc
  ];

  preCheck = ''
    export HOME=$(mktemp -d)
  '';

  pythonImportsCheck = [
    "plotnine"
  ];

  disabledTestPaths = [
    # Assertion Errors
    "tests/test_theme.py"
    "tests/test_scale_internals.py"
    "tests/test_scale_labelling.py"
    "tests/test_position.py"
    "tests/test_geom_text_label.py"
    "tests/test_geom_smooth.py"
    "tests/test_geom_segment.py"
    "tests/test_geom_ribbon_area.py"
    "tests/test_geom_map.py"
    "tests/test_facets.py"
    "tests/test_facet_labelling.py"
    "tests/test_coords.py"
    "tests/test_annotation_logticks.py"
  ];

  meta = with lib; {
    description = "Grammar of graphics for python";
    homepage = "https://plotnine.readthedocs.io/";
    changelog = "https://github.com/has2k1/plotnine/releases/tag/v${version}";
    license = licenses.mit;
    maintainers = with maintainers; [ onny ];
  };
}