1{ lib
2, stdenv
3, buildPythonPackage
4, pythonOlder
5, fetchPypi
6, Babel
7, markupsafe
8, pytestCheckHook
9}:
10
11buildPythonPackage rec {
12 pname = "Jinja2";
13 version = "3.0.2";
14 disabled = pythonOlder "3.6";
15
16 src = fetchPypi {
17 inherit pname version;
18 sha256 = "827a0e32839ab1600d4eb1c4c33ec5a8edfbc5cb42dafa13b81f182f97784b45";
19 };
20
21 propagatedBuildInputs = [
22 Babel
23 markupsafe
24 ];
25
26 # Multiple tests run out of stack space on 32bit systems with python2.
27 # See https://github.com/pallets/jinja/issues/1158
28 doCheck = !stdenv.is32bit;
29
30 checkInputs = [
31 pytestCheckHook
32 ];
33
34 pytestFlagsArray = [
35 # Avoid failure due to deprecation warning
36 # Fixed in https://github.com/python/cpython/pull/28153
37 # Remove after cpython 3.9.8
38 "-p no:warnings"
39 ];
40
41 meta = with lib; {
42 homepage = "http://jinja.pocoo.org/";
43 description = "Stand-alone template engine";
44 license = licenses.bsd3;
45 longDescription = ''
46 Jinja is a fast, expressive, extensible templating engine. Special
47 placeholders in the template allow writing code similar to Python
48 syntax. Then the template is passed data to render the final document.
49 an optional sandboxed environment.
50 '';
51 maintainers = with maintainers; [ pierron sjourdois ];
52 };
53}