1{
2 lib,
3 stdenv,
4 buildPythonPackage,
5 cheroot,
6 fetchPypi,
7 jaraco-collections,
8 more-itertools,
9 objgraph,
10 path,
11 portend,
12 pyopenssl,
13 pytest-cov-stub,
14 pytest-forked,
15 pytest-services,
16 pytestCheckHook,
17 python-memcached,
18 pythonAtLeast,
19 pythonOlder,
20 requests-toolbelt,
21 routes,
22 setuptools-scm,
23 simplejson,
24 zc-lockfile,
25}:
26
27buildPythonPackage rec {
28 pname = "cherrypy";
29 version = "18.10.0";
30 pyproject = true;
31
32 disabled = pythonOlder "3.7";
33
34 src = fetchPypi {
35 inherit pname version;
36 hash = "sha256-bHDnjuETAOiyHAdnxUKuaxAqScrFz9Tj4xPXu5B8WJE=";
37 };
38
39 postPatch = ''
40 # Disable doctest plugin because times out
41 substituteInPlace pytest.ini \
42 --replace-fail "--doctest-modules" "-vvv"
43 '';
44
45 build-system = [ setuptools-scm ];
46
47 dependencies = [
48 cheroot
49 jaraco-collections
50 more-itertools
51 portend
52 zc-lockfile
53 ];
54
55 nativeCheckInputs = [
56 objgraph
57 path
58 pytest-cov-stub
59 pytest-forked
60 pytest-services
61 pytestCheckHook
62 requests-toolbelt
63 ];
64
65 preCheck = ''
66 export CI=true
67 '';
68
69 pytestFlagsArray = [
70 "-W"
71 "ignore::DeprecationWarning"
72 ];
73
74 disabledTests =
75 [
76 # Keyboard interrupt ends test suite run
77 "KeyboardInterrupt"
78 # daemonize and autoreload tests have issue with sockets within sandbox
79 "daemonize"
80 "Autoreload"
81
82 "test_antistampede"
83 "test_file_stream"
84 "test_basic_request"
85 "test_3_Redirect"
86 "test_4_File_deletion"
87 ]
88 ++ lib.optionals (pythonAtLeast "3.11") [
89 "testErrorHandling"
90 "testHookErrors"
91 "test_HTTP10_KeepAlive"
92 "test_No_Message_Body"
93 "test_HTTP11_Timeout"
94 "testGzip"
95 "test_malformed_header"
96 "test_no_content_length"
97 "test_post_filename_with_special_characters"
98 "test_post_multipart"
99 "test_iterator"
100 "test_1_Ram_Concurrency"
101 "test_2_File_Concurrency"
102 ]
103 ++ lib.optionals stdenv.hostPlatform.isDarwin [ "test_block" ];
104
105 disabledTestPaths = lib.optionals stdenv.hostPlatform.isDarwin [
106 "cherrypy/test/test_config_server.py"
107 ];
108
109 __darwinAllowLocalNetworking = true;
110
111 pythonImportsCheck = [ "cherrypy" ];
112
113 optional-dependencies = {
114 json = [ simplejson ];
115 memcached_session = [ python-memcached ];
116 routes_dispatcher = [ routes ];
117 ssl = [ pyopenssl ];
118 # not packaged yet
119 xcgi = [
120 # flup
121 ];
122 };
123
124 meta = with lib; {
125 description = "Object-oriented HTTP framework";
126 mainProgram = "cherryd";
127 homepage = "https://cherrypy.dev/";
128 changelog = "https://github.com/cherrypy/cherrypy/blob/v${version}/CHANGES.rst";
129 license = licenses.bsd3;
130 maintainers = [ ];
131 };
132}