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