2021-06-28 23:13:55 +00:00
|
|
|
{ lib
|
|
|
|
, stdenv
|
2024-01-13 08:15:51 +00:00
|
|
|
, python
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-06-28 23:13:55 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
, fetchPypi
|
2022-05-18 14:49:53 +00:00
|
|
|
, babel
|
2020-09-25 04:45:31 +00:00
|
|
|
, markupsafe
|
2021-06-28 23:13:55 +00:00
|
|
|
, pytestCheckHook
|
2023-05-24 13:37:59 +00:00
|
|
|
, sphinxHook
|
|
|
|
, pallets-sphinx-themes
|
|
|
|
, sphinxcontrib-log-cabinet
|
|
|
|
, sphinx-issues
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "Jinja2";
|
2022-05-18 14:49:53 +00:00
|
|
|
version = "3.1.2";
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2023-03-15 16:39:30 +00:00
|
|
|
hash = "sha256-MTUacCpAip51laj8YVD8P0O7a/fjGXcMvA2535Q36FI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-06-28 23:13:55 +00:00
|
|
|
propagatedBuildInputs = [
|
2022-05-18 14:49:53 +00:00
|
|
|
babel
|
2021-06-28 23:13:55 +00:00
|
|
|
markupsafe
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
# Multiple tests run out of stack space on 32bit systems with python2.
|
|
|
|
# See https://github.com/pallets/jinja/issues/1158
|
2021-06-28 23:13:55 +00:00
|
|
|
doCheck = !stdenv.is32bit;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-06-28 23:13:55 +00:00
|
|
|
pytestCheckHook
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-12-06 16:07:01 +00:00
|
|
|
pytestFlagsArray = [
|
|
|
|
# Avoid failure due to deprecation warning
|
|
|
|
# Fixed in https://github.com/python/cpython/pull/28153
|
|
|
|
# Remove after cpython 3.9.8
|
|
|
|
"-p no:warnings"
|
|
|
|
];
|
|
|
|
|
2024-01-13 08:15:51 +00:00
|
|
|
passthru = {
|
|
|
|
doc = stdenv.mkDerivation {
|
|
|
|
# Forge look and feel of multi-output derivation as best as we can.
|
|
|
|
#
|
|
|
|
# Using 'outputs = [ "doc" ];' breaks a lot of assumptions.
|
|
|
|
name = "${pname}-${version}-doc";
|
|
|
|
inherit src pname version;
|
|
|
|
|
|
|
|
patches = [
|
|
|
|
# Fix import of "sphinxcontrib-log-cabinet"
|
|
|
|
./patches/import-order.patch
|
|
|
|
];
|
|
|
|
|
|
|
|
postInstallSphinx = ''
|
|
|
|
mv $out/share/doc/* $out/share/doc/python$pythonVersion-$pname-$version
|
|
|
|
'';
|
|
|
|
|
|
|
|
nativeBuildInputs = [
|
|
|
|
sphinxHook
|
|
|
|
sphinxcontrib-log-cabinet
|
|
|
|
pallets-sphinx-themes
|
|
|
|
sphinx-issues
|
|
|
|
];
|
|
|
|
|
|
|
|
inherit (python) pythonVersion;
|
|
|
|
inherit meta;
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2022-03-30 09:31:56 +00:00
|
|
|
homepage = "https://jinja.palletsprojects.com/";
|
2020-04-24 23:36:52 +00:00
|
|
|
description = "Stand-alone template engine";
|
|
|
|
license = licenses.bsd3;
|
|
|
|
longDescription = ''
|
2021-06-28 23:13:55 +00:00
|
|
|
Jinja is a fast, expressive, extensible templating engine. Special
|
|
|
|
placeholders in the template allow writing code similar to Python
|
|
|
|
syntax. Then the template is passed data to render the final document.
|
2020-04-24 23:36:52 +00:00
|
|
|
an optional sandboxed environment.
|
|
|
|
'';
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ pierron ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|