1{
2 lib,
3 buildPythonPackage,
4 pythonOlder,
5 fetchFromGitHub,
6 isPyPy,
7
8 # build-system
9 setuptools,
10
11 # propagates
12 markupsafe,
13
14 # optional-dependencies
15 babel,
16 lingua,
17
18 # tests
19 chameleon,
20 mock,
21 pytestCheckHook,
22}:
23
24buildPythonPackage rec {
25 pname = "mako";
26 version = "1.3.10";
27 pyproject = true;
28
29 disabled = pythonOlder "3.7";
30
31 src = fetchFromGitHub {
32 owner = "sqlalchemy";
33 repo = "mako";
34 tag = "rel_${lib.replaceStrings [ "." ] [ "_" ] version}";
35 hash = "sha256-lxGlYyKbrDpr2LHcsqTow+s2l8+g+63M5j8xJt++tGo=";
36 };
37
38 build-system = [ setuptools ];
39
40 dependencies = [ markupsafe ];
41
42 optional-dependencies = {
43 babel = [ babel ];
44 lingua = [ lingua ];
45 };
46
47 nativeCheckInputs = [
48 chameleon
49 mock
50 pytestCheckHook
51 ]
52 ++ lib.flatten (lib.attrValues optional-dependencies);
53
54 disabledTests = lib.optionals isPyPy [
55 # https://github.com/sqlalchemy/mako/issues/315
56 "test_alternating_file_names"
57 # https://github.com/sqlalchemy/mako/issues/238
58 "test_file_success"
59 "test_stdin_success"
60 # fails on pypy2.7
61 "test_bytestring_passthru"
62 ];
63
64 meta = with lib; {
65 description = "Super-fast templating language";
66 mainProgram = "mako-render";
67 homepage = "https://www.makotemplates.org/";
68 changelog = "https://docs.makotemplates.org/en/latest/changelog.html";
69 license = licenses.mit;
70 platforms = platforms.unix;
71 maintainers = with maintainers; [ ];
72 };
73}