1{ lib
2, stdenv
3, attrs
4, buildPythonPackage
5, fetchFromGitHub
6, hyperlink
7, hypothesis
8, incremental
9, python
10, pythonOlder
11, treq
12, tubes
13, twisted
14, typing-extensions
15, werkzeug
16, zope_interface
17}:
18
19buildPythonPackage rec {
20 pname = "klein";
21 version = "unstable-2022-06-26";
22 format = "setuptools";
23
24 disabled = pythonOlder "3.7";
25
26 src = fetchFromGitHub {
27 owner = "twisted";
28 repo = pname;
29 rev = "d8c2b92a3c77aa64c596696fb6f07172ecf94a74";
30 hash = "sha256-RDZqavkteUbARV78OctZtLIrE4RoYDVAanjwE5i/ZeM=";
31 };
32
33 propagatedBuildInputs = [
34 attrs
35 hyperlink
36 incremental
37 twisted
38 tubes
39 werkzeug
40 zope_interface
41 ] ++ lib.optionals (pythonOlder "3.8") [
42 typing-extensions
43 ];
44
45 checkInputs = [
46 hypothesis
47 treq
48 ];
49
50 checkPhase = ''
51 ${python.interpreter} -m twisted.trial -j $NIX_BUILD_CORES klein
52 '';
53
54 pythonImportsCheck = [
55 "klein"
56 ];
57
58 meta = with lib; {
59 description = "Klein Web Micro-Framework";
60 homepage = "https://github.com/twisted/klein";
61 license = licenses.mit;
62 maintainers = with maintainers; [ exarkun ];
63 };
64}