2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
stdenv,
|
|
|
|
python,
|
|
|
|
buildPythonPackage,
|
|
|
|
pythonOlder,
|
|
|
|
fetchPypi,
|
|
|
|
flit-core,
|
|
|
|
babel,
|
|
|
|
markupsafe,
|
|
|
|
pytestCheckHook,
|
|
|
|
sphinxHook,
|
|
|
|
pallets-sphinx-themes,
|
|
|
|
sphinxcontrib-log-cabinet,
|
|
|
|
sphinx-issues,
|
|
|
|
|
|
|
|
# Reverse dependency
|
|
|
|
sage,
|
2020-09-25 04:45:31 +00:00
|
|
|
}:
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2024-01-25 14:12:00 +00:00
|
|
|
pname = "jinja2";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "3.1.4";
|
2024-01-25 14:12:00 +00:00
|
|
|
pyproject = true;
|
2022-04-27 09:35:20 +00:00
|
|
|
|
|
|
|
disabled = pythonOlder "3.7";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
2024-05-15 15:35:15 +00:00
|
|
|
inherit pname version;
|
|
|
|
hash = "sha256-Sjruesu+cwOu3o6WSNE7i/iKQpKCqmEiqZPwrIAMs2k=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeBuildInputs = [ flit-core ];
|
2024-01-25 14:12:00 +00:00
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
propagatedBuildInputs = [ markupsafe ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
passthru.optional-dependencies = {
|
2024-06-05 15:53:02 +00:00
|
|
|
i18n = [ babel ];
|
2024-01-25 14:12:00 +00:00
|
|
|
};
|
|
|
|
|
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
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook ] ++ passthru.optional-dependencies.i18n;
|
2021-12-06 16:07:01 +00:00
|
|
|
|
2024-01-25 14:12:00 +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;
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
patches = [
|
|
|
|
# Fix import of "sphinxcontrib-log-cabinet"
|
|
|
|
./patches/import-order.patch
|
|
|
|
];
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
postInstallSphinx = ''
|
|
|
|
mv $out/share/doc/* $out/share/doc/python$pythonVersion-$pname-$version
|
|
|
|
'';
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
sphinxHook
|
|
|
|
sphinxcontrib-log-cabinet
|
|
|
|
pallets-sphinx-themes
|
|
|
|
sphinx-issues
|
|
|
|
];
|
2024-01-13 08:15:51 +00:00
|
|
|
|
2024-01-25 14:12:00 +00:00
|
|
|
inherit (python) pythonVersion;
|
|
|
|
inherit meta;
|
2024-01-13 08:15:51 +00:00
|
|
|
};
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit sage;
|
|
|
|
};
|
2024-05-15 15:35:15 +00:00
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
meta = with lib; {
|
2024-01-25 14:12:00 +00:00
|
|
|
changelog = "https://github.com/pallets/jinja/blob/${version}/CHANGES.rst";
|
|
|
|
description = "Very fast and expressive template engine";
|
|
|
|
downloadPage = "https://github.com/pallets/jinja";
|
|
|
|
homepage = "https://jinja.palletsprojects.com";
|
2020-04-24 23:36:52 +00:00
|
|
|
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
|
|
|
'';
|
2022-07-14 12:49:19 +00:00
|
|
|
maintainers = with maintainers; [ pierron ];
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
}
|