2022-07-18 16:21:45 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2024-01-13 08:15:51 +00:00
|
|
|
, pythonOlder
|
|
|
|
, fetchFromGitHub
|
|
|
|
, setuptools-scm
|
2022-07-18 16:21:45 +00:00
|
|
|
, matplotlib
|
2023-01-11 07:51:40 +00:00
|
|
|
, mizani
|
2022-07-18 16:21:45 +00:00
|
|
|
, pandas
|
2023-01-11 07:51:40 +00:00
|
|
|
, patsy
|
|
|
|
, scipy
|
|
|
|
, statsmodels
|
2024-01-13 08:15:51 +00:00
|
|
|
, geopandas
|
|
|
|
, pytestCheckHook
|
|
|
|
, scikit-misc
|
2023-01-11 07:51:40 +00:00
|
|
|
}:
|
2022-07-18 16:21:45 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "plotnine";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "0.13.0";
|
2024-01-13 08:15:51 +00:00
|
|
|
pyproject = true;
|
2023-01-11 07:51:40 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
disabled = pythonOlder "3.9";
|
2022-07-18 16:21:45 +00:00
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "has2k1";
|
|
|
|
repo = "plotnine";
|
|
|
|
rev = "refs/tags/v${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-qhmo1Ckc4OUzWCnjCNQvwsExB98/BCKydMZdB/yfOY0=";
|
2022-07-18 16:21:45 +00:00
|
|
|
};
|
|
|
|
|
2023-01-11 07:51:40 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
setuptools-scm
|
|
|
|
];
|
|
|
|
|
2022-07-18 16:21:45 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace " --cov=plotnine --cov-report=xml" ""
|
|
|
|
'';
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-07-18 16:21:45 +00:00
|
|
|
matplotlib
|
|
|
|
mizani
|
|
|
|
pandas
|
|
|
|
patsy
|
|
|
|
scipy
|
|
|
|
statsmodels
|
|
|
|
];
|
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2022-07-18 16:21:45 +00:00
|
|
|
geopandas
|
|
|
|
pytestCheckHook
|
|
|
|
scikit-misc
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
export HOME=$(mktemp -d)
|
|
|
|
'';
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"plotnine"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTestPaths = [
|
2024-01-13 08:15:51 +00:00
|
|
|
# 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.
|
2024-02-29 20:09:43 +00:00
|
|
|
"tests/test_aes.py"
|
2024-01-13 08:15:51 +00:00
|
|
|
"tests/test_annotation_logticks.py"
|
|
|
|
"tests/test_coords.py"
|
2022-07-18 16:21:45 +00:00
|
|
|
"tests/test_facet_labelling.py"
|
2024-02-29 20:09:43 +00:00
|
|
|
"tests/test_facets.py"
|
2024-01-13 08:15:51 +00:00
|
|
|
"tests/test_geom_bar_col_histogram.py"
|
|
|
|
"tests/test_geom_bin_2d.py"
|
|
|
|
"tests/test_geom_boxplot.py"
|
2024-02-29 20:09:43 +00:00
|
|
|
"tests/test_geom_count.py"
|
|
|
|
"tests/test_geom_density_2d.py"
|
2024-01-13 08:15:51 +00:00
|
|
|
"tests/test_geom_density.py"
|
|
|
|
"tests/test_geom_dotplot.py"
|
2024-02-29 20:09:43 +00:00
|
|
|
"tests/test_geom_freqpoly.py"
|
2024-01-13 08:15:51 +00:00
|
|
|
"tests/test_geom_map.py"
|
|
|
|
"tests/test_geom_path_line_step.py"
|
|
|
|
"tests/test_geom_point.py"
|
|
|
|
"tests/test_geom_raster.py"
|
2024-02-29 20:09:43 +00:00
|
|
|
"tests/test_geom_rect_tile.py"
|
2024-01-13 08:15:51 +00:00
|
|
|
"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_position.py"
|
|
|
|
"tests/test_qplot.py"
|
|
|
|
"tests/test_scale_internals.py"
|
|
|
|
"tests/test_scale_labelling.py"
|
|
|
|
"tests/test_stat_ecdf.py"
|
2024-02-29 20:09:43 +00:00
|
|
|
"tests/test_stat_function.py"
|
2024-01-13 08:15:51 +00:00
|
|
|
"tests/test_stat_summary.py"
|
|
|
|
"tests/test_theme.py"
|
|
|
|
|
|
|
|
# Linting / formatting: useless as it has nothing to do with the package functionning
|
|
|
|
# Disabling this prevents adding a dependency on 'ruff' and 'black'.
|
|
|
|
"tests/test_lint_and_format.py"
|
2022-07-18 16:21:45 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
description = "Grammar of graphics for python";
|
2023-01-11 07:51:40 +00:00
|
|
|
homepage = "https://plotnine.readthedocs.io/";
|
|
|
|
changelog = "https://github.com/has2k1/plotnine/releases/tag/v${version}";
|
2022-07-18 16:21:45 +00:00
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ onny ];
|
|
|
|
};
|
|
|
|
}
|