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