2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
2021-01-15 22:18:51 +00:00
|
|
|
, fetchFromGitHub
|
2020-04-24 23:36:52 +00:00
|
|
|
, buildPythonPackage
|
2021-08-25 08:27:29 +00:00
|
|
|
, poetry-core
|
2021-08-22 07:53:02 +00:00
|
|
|
, docopt-ng
|
2020-04-24 23:36:52 +00:00
|
|
|
, easywatch
|
|
|
|
, jinja2
|
2021-01-15 22:18:51 +00:00
|
|
|
, pytestCheckHook
|
2021-02-05 17:12:51 +00:00
|
|
|
, pytest-check
|
2021-08-25 08:27:29 +00:00
|
|
|
, pythonOlder
|
2021-01-15 22:18:51 +00:00
|
|
|
, markdown
|
2022-04-27 09:35:20 +00:00
|
|
|
, testers
|
2021-08-25 08:27:29 +00:00
|
|
|
, tomlkit
|
2021-06-28 23:13:55 +00:00
|
|
|
, staticjinja
|
2022-01-25 03:21:06 +00:00
|
|
|
, callPackage
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "staticjinja";
|
2022-06-16 17:23:12 +00:00
|
|
|
version = "4.1.3";
|
2021-02-13 14:23:35 +00:00
|
|
|
format = "pyproject";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-08-25 08:27:29 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
# No tests in pypi
|
2021-01-15 22:18:51 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "staticjinja";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2022-06-16 17:23:12 +00:00
|
|
|
sha256 = "sha256-w6ge5MQXNRHCM43jKnagTlbquJJys7mprgBOS2uuwHQ=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
nativeBuildInputs = [
|
2021-08-25 08:27:29 +00:00
|
|
|
poetry-core
|
2021-02-13 14:23:35 +00:00
|
|
|
];
|
|
|
|
|
2021-01-15 22:18:51 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
jinja2
|
2021-08-22 07:53:02 +00:00
|
|
|
docopt-ng
|
2021-01-15 22:18:51 +00:00
|
|
|
easywatch
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
pytestCheckHook
|
2021-02-05 17:12:51 +00:00
|
|
|
pytest-check
|
2021-01-15 22:18:51 +00:00
|
|
|
markdown
|
2021-08-25 08:27:29 +00:00
|
|
|
tomlkit
|
2021-01-15 22:18:51 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-02-13 14:23:35 +00:00
|
|
|
# The tests need to find and call the installed staticjinja executable
|
2021-01-15 22:18:51 +00:00
|
|
|
preCheck = ''
|
2021-02-05 17:12:51 +00:00
|
|
|
export PATH="$PATH:$out/bin";
|
2021-01-15 22:18:51 +00:00
|
|
|
'';
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-25 03:21:06 +00:00
|
|
|
passthru.tests = {
|
2022-04-27 09:35:20 +00:00
|
|
|
version = testers.testVersion { package = staticjinja; };
|
2022-01-25 03:21:06 +00:00
|
|
|
minimal-template = callPackage ./test-minimal-template {};
|
2021-06-28 23:13:55 +00:00
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A library and cli tool that makes it easy to build static sites using Jinja2";
|
|
|
|
homepage = "https://staticjinja.readthedocs.io/en/latest/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ fgaz ];
|
|
|
|
};
|
|
|
|
}
|