Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ lib 2, stdenv 3, buildPythonPackage 4, cheroot 5, fetchPypi 6, jaraco_collections 7, more-itertools 8, objgraph 9, path 10, portend 11, pyopenssl 12, pytest-forked 13, pytest-services 14, pytestCheckHook 15, python-memcached 16, pythonAtLeast 17, pythonOlder 18, requests-toolbelt 19, routes 20, setuptools-scm 21, simplejson 22, zc_lockfile 23}: 24 25buildPythonPackage rec { 26 pname = "cherrypy"; 27 version = "18.8.0"; 28 format = "setuptools"; 29 30 disabled = pythonOlder "3.7" || pythonAtLeast "3.11"; 31 32 src = fetchPypi { 33 pname = "CherryPy"; 34 inherit version; 35 hash = "sha256-m0jPuoovFtW2QZzGV+bVHbAFujXF44JORyi7A7vH75s="; 36 }; 37 38 postPatch = '' 39 # Disable doctest plugin because times out 40 substituteInPlace pytest.ini \ 41 --replace "--doctest-modules" "-vvv" \ 42 --replace "-p pytest_cov" "" \ 43 --replace "--no-cov-on-fail" "" 44 sed -i "/--cov/d" pytest.ini 45 ''; 46 47 nativeBuildInputs = [ 48 setuptools-scm 49 ]; 50 51 propagatedBuildInputs = [ 52 cheroot 53 portend 54 more-itertools 55 zc_lockfile 56 jaraco_collections 57 ]; 58 59 nativeCheckInputs = [ 60 objgraph 61 path 62 pytest-forked 63 pytest-services 64 pytestCheckHook 65 requests-toolbelt 66 ]; 67 68 pytestFlagsArray = [ 69 "-W" 70 "ignore::DeprecationWarning" 71 ]; 72 73 disabledTests = [ 74 # Keyboard interrupt ends test suite run 75 "KeyboardInterrupt" 76 # daemonize and autoreload tests have issue with sockets within sandbox 77 "daemonize" 78 "Autoreload" 79 80 "test_antistampede" 81 "test_file_stream" 82 "test_basic_request" 83 "test_3_Redirect" 84 "test_4_File_deletion" 85 ] ++ lib.optionals stdenv.isDarwin [ 86 "test_block" 87 ]; 88 89 disabledTestPaths = lib.optionals stdenv.isDarwin [ 90 "cherrypy/test/test_config_server.py" 91 ]; 92 93 __darwinAllowLocalNetworking = true; 94 95 pythonImportsCheck = [ 96 "cherrypy" 97 ]; 98 99 passthru.optional-dependencies = { 100 json = [ simplejson ]; 101 memcached_session = [ python-memcached ]; 102 routes_dispatcher = [ routes ]; 103 ssl = [ pyopenssl ]; 104 # not packaged yet 105 xcgi = [ /* flup */ ]; 106 }; 107 108 meta = with lib; { 109 description = "Object-oriented HTTP framework"; 110 homepage = "https://cherrypy.dev/"; 111 license = licenses.bsd3; 112 maintainers = with maintainers; [ ]; 113 }; 114}