nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
1{
2 lib,
3 fetchFromGitHub,
4 buildPythonPackage,
5 poetry-core,
6 docopt-ng,
7 easywatch,
8 jinja2,
9 pytestCheckHook,
10 pytest-check,
11 markdown,
12 testers,
13 tomlkit,
14 typing-extensions,
15 staticjinja,
16 callPackage,
17}:
18
19buildPythonPackage rec {
20 pname = "staticjinja";
21 version = "5.0.0";
22 pyproject = true;
23
24 # No tests in pypi
25 src = fetchFromGitHub {
26 owner = "staticjinja";
27 repo = "staticjinja";
28 rev = version;
29 hash = "sha256-LfJTQhZtnTOm39EWF1m2MP5rxz/5reE0G1Uk9L7yx0w=";
30 };
31
32 nativeBuildInputs = [ poetry-core ];
33
34 propagatedBuildInputs = [
35 jinja2
36 docopt-ng
37 easywatch
38 ];
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 pytest-check
43 markdown
44 tomlkit
45 typing-extensions
46 ];
47
48 # The tests need to find and call the installed staticjinja executable
49 preCheck = ''
50 export PATH="$PATH:$out/bin";
51 '';
52
53 passthru.tests = {
54 version = testers.testVersion { package = staticjinja; };
55 minimal-template = callPackage ./test-minimal-template { };
56 };
57
58 meta = {
59 description = "Library and cli tool that makes it easy to build static sites using Jinja2";
60 mainProgram = "staticjinja";
61 homepage = "https://staticjinja.readthedocs.io/en/latest/";
62 license = lib.licenses.mit;
63 maintainers = with lib.maintainers; [ fgaz ];
64 };
65}