1{ lib, stdenv, buildPythonPackage, fetchPypi, isPy3k
2, setuptools-scm
3, cheroot, portend, more-itertools, zc_lockfile, routes
4, jaraco_collections
5, objgraph, pytest, pytest-cov, pathpy, requests-toolbelt, pytest-services
6, fetchpatch
7}:
8
9buildPythonPackage rec {
10 pname = "cherrypy";
11 version = "18.6.0";
12
13 disabled = !isPy3k;
14
15 src = fetchPypi {
16 pname = "CherryPy";
17 inherit version;
18 sha256 = "16f410izp2c4qhn4n3l5l3qirmkf43h2amjqms8hkl0shgfqwq2n";
19 };
20
21 patches = [
22 # 1/3 Fix compatibility with pytest 6. Will be part of the next release after 18.6
23 (fetchpatch {
24 url = "https://github.com/cherrypy/cherrypy/pull/1897/commits/59c0e19d7df8680e36afc96756dce72435121448.patch";
25 sha256 = "1jachbvp505gndccdhny0c3grzdrmvmbzq4kw55jx93ay94ni6p0";
26 })
27 # 2/3 Fix compatibility with pytest 6. Will be part of the next release after 18.6
28 (fetchpatch {
29 url = "https://github.com/cherrypy/cherrypy/pull/1897/commits/4a6287b73539adcb7b0ae72d69644a1ced1f7eaa.patch";
30 sha256 = "0nz40qmgxknkbjsdzfzcqfxdsmsxx3v104fb0h04yvs76mqvw3i4";
31 })
32 # 3/3 Fix compatibility with pytest 6. Will be part of the next release after 18.6
33 (fetchpatch {
34 url = "https://github.com/cherrypy/cherrypy/commit/3bae7f06868553b006915f05ff14d86163f59a7d.patch";
35 sha256 = "1z0bv23ybyw87rf1i8alsdi3gc2bzmdj9d0kjsghdkvi3zdp4n8q";
36 })
37 ];
38
39 nativeBuildInputs = [ setuptools-scm ];
40
41 propagatedBuildInputs = [
42 # required
43 cheroot portend more-itertools zc_lockfile
44 jaraco_collections
45 # optional
46 routes
47 ];
48
49 checkInputs = [
50 objgraph pytest pytest-cov pathpy requests-toolbelt pytest-services
51 ];
52
53 # Keyboard interrupt ends test suite run
54 # daemonize and autoreload tests have issue with sockets within sandbox
55 # Disable doctest plugin because times out
56 checkPhase = ''
57 substituteInPlace pytest.ini --replace "--doctest-modules" ""
58 pytest \
59 -k 'not KeyboardInterrupt and not daemonize and not Autoreload' \
60 --deselect=cherrypy/test/test_static.py::StaticTest::test_null_bytes \
61 --deselect=cherrypy/test/test_tools.py::ToolTests::testCombinedTools \
62 ${lib.optionalString stdenv.isDarwin
63 "--deselect=cherrypy/test/test_bus.py::BusMethodTests::test_block --deselect=cherrypy/test/test_config_server.py"}
64 '';
65
66 __darwinAllowLocalNetworking = true;
67
68 meta = with lib; {
69 homepage = "https://www.cherrypy.org";
70 description = "A pythonic, object-oriented HTTP framework";
71 license = licenses.bsd3;
72 };
73}