about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/pygal/default.nix
blob: 4b6de769859b407ff810149e9d08e17c4bd8d944 (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
{ lib
, buildPythonPackage
, fetchPypi

# build-system
, setuptools

# dependencies
, importlib-metadata

# optional-dependencies
, lxml
, cairosvg

# tests
, pyquery
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "pygal";
  version = "3.0.4";
  pyproject = true;

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

  postPatch = ''
    substituteInPlace setup.py \
      --replace pytest-runner ""
  '';

  nativeBuildInputs = [
    setuptools
  ];

  propagatedBuildInputs = [
    importlib-metadata
  ];

  passthru.optional-dependencies = {
    lxml = [ lxml ];
    png = [ cairosvg ];
  };

  nativeCheckInputs = [
    pyquery
    pytestCheckHook
  ] ++ passthru.optional-dependencies.png;

  preCheck = ''
    # necessary on darwin to pass the testsuite
    export LANG=en_US.UTF-8
  '';

  meta = with lib; {
    changelog = "https://github.com/Kozea/pygal/blob/${version}/docs/changelog.rst";
    downloadPage = "https://github.com/Kozea/pygal";
    description = "Sexy and simple python charting";
    homepage = "http://www.pygal.org";
    license = licenses.lgpl3Plus;
    maintainers = with maintainers; [ ];
  };
}