1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pythonOlder
5
6# build-system
7, setuptools
8, wheel
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 = "unstable-2023-09-05";
28 format = "pyproject";
29
30 disabled = pythonOlder "3.7";
31
32 src = fetchFromGitHub {
33 owner = "twisted";
34 repo = pname;
35 rev = "44b356ede27a667252ae5392014c802f0492c017";
36 hash = "sha256-zHdyyx5IseFWr25BGLL0dDM8/5BDehsvbxIci+DEo9s=";
37 };
38
39 nativeBuildInputs = [
40 setuptools
41 wheel
42 ];
43
44 propagatedBuildInputs = [
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 = [
66 "klein"
67 ];
68
69 meta = with lib; {
70 changelog = "https://github.com/twisted/klein/releases/tag/${version}";
71 description = "Klein Web Micro-Framework";
72 homepage = "https://github.com/twisted/klein";
73 license = licenses.mit;
74 maintainers = with maintainers; [ exarkun ];
75 };
76}