about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/staticjinja/default.nix
blob: d49bae2eab910f8fd3494710e80f8fddd6d51a11 (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
{ lib
, fetchFromGitHub
, buildPythonPackage
, isPy27
, docopt
, easywatch
, jinja2
, pytestCheckHook
, markdown
}:

buildPythonPackage rec {
  pname = "staticjinja";
  version = "0.4.0";

  disabled = isPy27; # 0.4.0 drops python2 support

  # For some reason, in pypi the tests get disabled when using
  # PY_IGNORE_IMPORTMISMATCH, so we just fetch from GitHub
  src = fetchFromGitHub {
    owner = "staticjinja";
    repo = pname;
    rev = version;
    sha256 = "0pysk8pzmcg1nfxz8m4i6bvww71w2zg6xp33zgg5vrf8yd2dfx9i";
  };

  propagatedBuildInputs = [
    jinja2
    docopt
    easywatch
  ];

  checkInputs = [
    pytestCheckHook
    markdown
  ];

  # Import paths differ by a "build/lib" subdirectory, but the files are
  # the same, so we ignore import mismatches.
  preCheck = ''
    export PY_IGNORE_IMPORTMISMATCH=1
  '';

  meta = with lib; {
    description = "A library and cli tool that makes it easy to build static sites using Jinja2";
    homepage = "https://staticjinja.readthedocs.io/en/latest/";
    license = licenses.mit;
    maintainers = with maintainers; [ fgaz ];
  };
}