1{ lib
2, fetchFromGitHub
3, buildPythonPackage
4, poetry-core
5, docopt-ng
6, easywatch
7, jinja2
8, pytestCheckHook
9, pytest-check
10, pythonOlder
11, markdown
12, testVersion
13, tomlkit
14, staticjinja
15}:
16
17buildPythonPackage rec {
18 pname = "staticjinja";
19 version = "4.1.1";
20 format = "pyproject";
21
22 disabled = pythonOlder "3.6";
23
24 # No tests in pypi
25 src = fetchFromGitHub {
26 owner = "staticjinja";
27 repo = pname;
28 rev = version;
29 sha256 = "sha256-Bpgff3VaTylnYpkWoaWEiRWu4sYSP6dLbHDOjAhj7BM=";
30 };
31
32 nativeBuildInputs = [
33 poetry-core
34 ];
35
36 propagatedBuildInputs = [
37 jinja2
38 docopt-ng
39 easywatch
40 ];
41
42 checkInputs = [
43 pytestCheckHook
44 pytest-check
45 markdown
46 tomlkit
47 ];
48
49 # The tests need to find and call the installed staticjinja executable
50 preCheck = ''
51 export PATH="$PATH:$out/bin";
52 '';
53
54 passthru.tests.version = testVersion {
55 package = staticjinja;
56 };
57
58 meta = with lib; {
59 description = "A library and cli tool that makes it easy to build static sites using Jinja2";
60 homepage = "https://staticjinja.readthedocs.io/en/latest/";
61 license = licenses.mit;
62 maintainers = with maintainers; [ fgaz ];
63 };
64}