1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6
7 # build-system
8 setuptools,
9
10 # dependencies
11 attrs,
12 hyperlink,
13 incremental,
14 tubes,
15 twisted,
16 werkzeug,
17 zope-interface,
18
19 # tests
20 idna,
21 python,
22 treq,
23}:
24
25buildPythonPackage rec {
26 pname = "klein";
27 version = "24.8.0";
28 pyproject = true;
29
30 disabled = pythonOlder "3.7";
31
32 src = fetchFromGitHub {
33 owner = "twisted";
34 repo = "klein";
35 tag = version;
36 hash = "sha256-2/zl4fS9ZP73quPmGnz2+brEt84ODgVS89Om/cUsj0M=";
37 };
38
39 build-system = [
40 incremental
41 setuptools
42 ];
43
44 dependencies = [
45 attrs
46 hyperlink
47 incremental
48 twisted
49 tubes
50 werkzeug
51 zope-interface
52 ];
53
54 nativeCheckInputs = [
55 idna
56 treq
57 ];
58
59 checkPhase = ''
60 runHook preCheck
61 ${python.interpreter} -m twisted.trial klein
62 runHook postCheck
63 '';
64
65 pythonImportsCheck = [ "klein" ];
66
67 meta = with lib; {
68 changelog = "https://github.com/twisted/klein/releases/tag/${version}";
69 description = "Klein Web Micro-Framework";
70 homepage = "https://github.com/twisted/klein";
71 license = licenses.mit;
72 maintainers = with maintainers; [ exarkun ];
73 };
74}