1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5
6 # optionals
7 genshi,
8
9 # tests
10 pytestCheckHook,
11 webtest,
12}:
13
14buildPythonPackage rec {
15 pname = "static3";
16 version = "0.7.0";
17 format = "setuptools";
18
19 src = fetchFromGitHub {
20 owner = "rmohr";
21 repo = "static3";
22 rev = "v${version}";
23 hash = "sha256-uFgv+57/UZs4KoOdkFxbvTEDQrJbb0iYJ5JoWWN4yFY=";
24 };
25
26 postPatch = ''
27 substituteInPlace setup.py \
28 --replace ", 'pytest-cov'" ""
29 '';
30
31 optional-dependencies = {
32 KidMagic = [
33 # TODO: kid
34 ];
35 Genshimagic = [ genshi ];
36 };
37
38 pythonImportsCheck = [ "static" ];
39
40 nativeCheckInputs = [
41 pytestCheckHook
42 webtest
43 ]
44 ++ lib.flatten (builtins.attrValues optional-dependencies);
45
46 meta = with lib; {
47 changelog = "https://github.com/rmohr/static3/releases/tag/v${version}";
48 description = "Really simple WSGI way to serve static (or mixed) content";
49 mainProgram = "static";
50 homepage = "https://github.com/rmohr/static3";
51 license = licenses.lgpl21Only;
52 maintainers = with maintainers; [ hexa ];
53 };
54}