summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/plotnine/default.nix
blob: 0a71ca5c0759c7a27497d30815856792c34f37d0 (plain)
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,

  # build-system
  setuptools-scm,

  # dependencies
  matplotlib,
  mizani,
  pandas,
  scipy,
  statsmodels,

  # tests
  geopandas,
  pytestCheckHook,
  pytest-cov-stub,
  scikit-misc,
  writableTmpDirAsHomeHook,
}:

buildPythonPackage rec {
  pname = "plotnine";
  version = "0.15.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "has2k1";
    repo = "plotnine";
    tag = "v${version}";
    hash = "sha256-JjSBcPRMmxAIoQsr8ESfgcf+EWBLsq1H+q56iyD3X84=";
  };

  build-system = [ setuptools-scm ];

  dependencies = [
    matplotlib
    mizani
    pandas
    scipy
    statsmodels
  ];

  nativeCheckInputs = [
    geopandas
    pytestCheckHook
    pytest-cov-stub
    scikit-misc
    writableTmpDirAsHomeHook
  ];

  pythonImportsCheck = [ "plotnine" ];

  disabledTests = [
    # Tries to change locale. The issued warning causes this test to fail.
    # UserWarning: Could not set locale to English/United States. Some date-related tests may fail
    "test_no_after_scale_warning"

    # Assertion Errors:
    # Generated plot images do not exactly match the expected files.
    # After manually checking, this is caused by extremely subtle differences in label placement.
    # See https://github.com/has2k1/plotnine/issues/627
    "test_aesthetics"
  ];

  disabledTestPaths = [
    # Assertion Errors:
    # Generated plot images do not exactly match the expected files.
    # After manually checking, this is caused by extremely subtle differences in label placement.
    "tests/test_aes.py"
    "tests/test_annotation_logticks.py"
    "tests/test_coords.py"
    "tests/test_facet_labelling.py"
    "tests/test_facets.py"
    "tests/test_geom_bar_col_histogram.py"
    "tests/test_geom_bin_2d.py"
    "tests/test_geom_boxplot.py"
    "tests/test_geom_count.py"
    "tests/test_geom_density_2d.py"
    "tests/test_geom_density.py"
    "tests/test_geom_dotplot.py"
    "tests/test_geom_freqpoly.py"
    "tests/test_geom_map.py"
    "tests/test_geom_path_line_step.py"
    "tests/test_geom_point.py"
    "tests/test_geom_pointdensity.py"
    "tests/test_geom_polygon.py"
    "tests/test_geom_raster.py"
    "tests/test_geom_rect_tile.py"
    "tests/test_geom_ribbon_area.py"
    "tests/test_geom_sina.py"
    "tests/test_geom_smooth.py"
    "tests/test_geom_text_label.py"
    "tests/test_geom_violin.py"
    "tests/test_layout.py"
    "tests/test_plot_composition.py"
    "tests/test_position.py"
    "tests/test_qplot.py"
    "tests/test_scale_internals.py"
    "tests/test_scale_labelling.py"
    "tests/test_stat_ecdf.py"
    "tests/test_stat_ellipse.py"
    "tests/test_stat_function.py"
    "tests/test_stat_summary.py"
    "tests/test_theme.py"

    # Linting / formatting: useless as it has nothing to do with the package functioning
    # Disabling this prevents adding a dependency on 'ruff' and 'black'.
    "tests/test_lint_and_format.py"
  ];

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