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