1
0
Fork 1
mirror of https://github.com/NixOS/nixpkgs.git synced 2024-12-20 21:17:46 +00:00
nixpkgs/pkgs/development/python-modules/pygal/default.nix
Profpatsch 4a7f99d55d treewide: with stdenv.lib; in meta -> with lib;
Part of: https://github.com/NixOS/nixpkgs/issues/108938

meta = with stdenv.lib;

is a widely used pattern. We want to slowly remove
the `stdenv.lib` indirection and encourage people
to use `lib` directly. Thus let’s start with the meta
field.

This used a rewriting script to mostly automatically
replace all occurances of this pattern, and add the
`lib` argument to the package header if it doesn’t
exist yet.

The script in its current form is available at
https://cs.tvl.fyi/depot@2f807d7f141068d2d60676a89213eaa5353ca6e0/-/blob/users/Profpatsch/nixpkgs-rewriter/default.nix
2021-01-11 10:38:22 +01:00

68 lines
1.4 KiB
Nix

{ lib, stdenv
, buildPythonPackage
, fetchPypi
, fetchpatch
, isPyPy
, flask
, pyquery
, pytest
, pytestrunner
, cairosvg
, tinycss
, cssselect
, lxml
}:
buildPythonPackage rec {
pname = "pygal";
version = "2.4.0";
doCheck = !isPyPy; # one check fails with pypy
src = fetchPypi {
inherit pname version;
sha256 = "9204f05380b02a8a32f9bf99d310b51aa2a932cba5b369f7a4dc3705f0a4ce83";
};
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";
})
];
buildInputs = [
flask
pyquery
# Should be a check input, but upstream lists it under "setup_requires".
# https://github.com/Kozea/pygal/issues/430
pytestrunner
];
checkInputs = [
pytest
];
preCheck = ''
# necessary on darwin to pass the testsuite
export LANG=en_US.UTF-8
'';
postPatch = ''
substituteInPlace setup.cfg --replace "[pytest]" "[tool:pytest]"
'';
propagatedBuildInputs = [ cairosvg tinycss cssselect ]
++ stdenv.lib.optionals (!isPyPy) [ lxml ];
meta = with lib; {
description = "Sexy and simple python charting";
homepage = "http://www.pygal.org";
license = licenses.lgpl3Plus;
maintainers = with maintainers; [ sjourdois ];
};
}