depot/third_party/nixpkgs/pkgs/development/python-modules/staticjinja/default.nix
Default email bcb2f287e1 Project import generated by Copybara.
GitOrigin-RevId: d603719ec6e294f034936c0d0dc06f689d91b6c3
2024-06-20 20:27:18 +05:30

68 lines
1.3 KiB
Nix

{
lib,
fetchFromGitHub,
buildPythonPackage,
poetry-core,
docopt-ng,
easywatch,
jinja2,
pytestCheckHook,
pytest-check,
pythonOlder,
markdown,
testers,
tomlkit,
typing-extensions,
staticjinja,
callPackage,
}:
buildPythonPackage rec {
pname = "staticjinja";
version = "5.0.0";
format = "pyproject";
disabled = pythonOlder "3.6";
# No tests in pypi
src = fetchFromGitHub {
owner = "staticjinja";
repo = pname;
rev = version;
hash = "sha256-LfJTQhZtnTOm39EWF1m2MP5rxz/5reE0G1Uk9L7yx0w=";
};
nativeBuildInputs = [ poetry-core ];
propagatedBuildInputs = [
jinja2
docopt-ng
easywatch
];
nativeCheckInputs = [
pytestCheckHook
pytest-check
markdown
tomlkit
typing-extensions
];
# The tests need to find and call the installed staticjinja executable
preCheck = ''
export PATH="$PATH:$out/bin";
'';
passthru.tests = {
version = testers.testVersion { package = staticjinja; };
minimal-template = callPackage ./test-minimal-template { };
};
meta = with lib; {
description = "Library and cli tool that makes it easy to build static sites using Jinja2";
mainProgram = "staticjinja";
homepage = "https://staticjinja.readthedocs.io/en/latest/";
license = licenses.mit;
maintainers = with maintainers; [ fgaz ];
};
}