2021-01-25 08:26:54 +00:00
|
|
|
{ lib
|
2018-10-17 04:27:15 +00:00
|
|
|
, buildPythonPackage
|
|
|
|
, fetchPypi
|
2021-01-05 15:47:21 +00:00
|
|
|
, fetchpatch
|
2018-10-17 04:27:15 +00:00
|
|
|
, isPyPy
|
|
|
|
, flask
|
|
|
|
, pyquery
|
|
|
|
, pytest
|
2021-07-20 21:07:53 +00:00
|
|
|
, pytest-runner
|
2018-10-17 04:27:15 +00:00
|
|
|
, cairosvg
|
|
|
|
, tinycss
|
|
|
|
, cssselect
|
|
|
|
, lxml
|
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "pygal";
|
2018-11-04 10:35:11 +00:00
|
|
|
version = "2.4.0";
|
2018-10-17 04:27:15 +00:00
|
|
|
|
2021-01-05 15:47:21 +00:00
|
|
|
doCheck = !isPyPy; # one check fails with pypy
|
2018-10-17 04:27:15 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2018-11-04 10:35:11 +00:00
|
|
|
sha256 = "9204f05380b02a8a32f9bf99d310b51aa2a932cba5b369f7a4dc3705f0a4ce83";
|
2018-10-17 04:27:15 +00:00
|
|
|
};
|
2021-01-05 15:47:21 +00:00
|
|
|
patches = [
|
|
|
|
# Fixes compatibility with latest pytest. October 12, 2020.
|
|
|
|
# Should be included in the next release after 2.4.0
|
|
|
|
(fetchpatch {
|
|
|
|
url = "https://github.com/Kozea/pygal/commit/19e5399be18a054b3b293f4a8a2777d2df4f9c18.patch";
|
|
|
|
sha256 = "1j0hpcvd2mhi449wmlr0ml9gw4cakqk3av1j79bi2qy86dyrss2l";
|
|
|
|
})
|
|
|
|
];
|
2018-10-17 04:27:15 +00:00
|
|
|
|
2019-01-12 14:08:21 +00:00
|
|
|
buildInputs = [
|
|
|
|
flask
|
|
|
|
pyquery
|
|
|
|
|
|
|
|
# Should be a check input, but upstream lists it under "setup_requires".
|
|
|
|
# https://github.com/Kozea/pygal/issues/430
|
2021-07-20 21:07:53 +00:00
|
|
|
pytest-runner
|
2019-01-12 14:08:21 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytest
|
|
|
|
];
|
|
|
|
|
|
|
|
preCheck = ''
|
|
|
|
# necessary on darwin to pass the testsuite
|
|
|
|
export LANG=en_US.UTF-8
|
|
|
|
'';
|
|
|
|
|
2019-06-15 08:07:07 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace setup.cfg --replace "[pytest]" "[tool:pytest]"
|
|
|
|
'';
|
|
|
|
|
2018-10-17 04:27:15 +00:00
|
|
|
propagatedBuildInputs = [ cairosvg tinycss cssselect ]
|
2021-01-24 00:29:22 +00:00
|
|
|
++ lib.optionals (!isPyPy) [ lxml ];
|
2018-10-17 04:27:15 +00:00
|
|
|
|
2021-01-11 07:54:33 +00:00
|
|
|
meta = with lib; {
|
2018-10-17 04:27:15 +00:00
|
|
|
description = "Sexy and simple python charting";
|
2020-04-01 01:11:51 +00:00
|
|
|
homepage = "http://www.pygal.org";
|
2021-01-05 16:47:23 +00:00
|
|
|
license = licenses.lgpl3Plus;
|
2018-10-17 04:27:15 +00:00
|
|
|
maintainers = with maintainers; [ sjourdois ];
|
|
|
|
};
|
|
|
|
|
|
|
|
}
|