Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
1{ 2 lib, 3 stdenv, 4 buildPythonPackage, 5 fetchPypi, 6 jaraco-functools, 7 jaraco-text, 8 more-itertools, 9 portend, 10 pypytools, 11 pytest-mock, 12 pytestCheckHook, 13 pythonOlder, 14 requests, 15 requests-toolbelt, 16 requests-unixsocket, 17 setuptools-scm, 18 six, 19}: 20 21buildPythonPackage rec { 22 pname = "cheroot"; 23 version = "10.0.1"; 24 format = "setuptools"; 25 26 disabled = pythonOlder "3.7"; 27 28 src = fetchPypi { 29 inherit pname version; 30 hash = "sha256-4LgveXZY0muGE+yOtWPDsI5r1qeSHp1Qib0Rda0bF0A="; 31 }; 32 33 # remove setuptools-scm-git-archive dependency 34 # https://github.com/cherrypy/cheroot/commit/f0c51af263e20f332c6f675aa90ec6705ae4f5d1 35 # there is a difference between the github source and the pypi tarball source, 36 # and it is not easy to apply patches. 37 postPatch = '' 38 substituteInPlace pyproject.toml \ 39 --replace '"setuptools_scm_git_archive>=1.1",' "" 40 substituteInPlace setup.cfg \ 41 --replace "setuptools_scm_git_archive>=1.0" "" 42 ''; 43 44 nativeBuildInputs = [ setuptools-scm ]; 45 46 propagatedBuildInputs = [ 47 jaraco-functools 48 more-itertools 49 six 50 ]; 51 52 nativeCheckInputs = [ 53 jaraco-text 54 portend 55 pypytools 56 pytest-mock 57 pytestCheckHook 58 requests 59 requests-toolbelt 60 requests-unixsocket 61 ]; 62 63 # Disable doctest plugin because times out 64 # Disable xdist (-n arg) because it's incompatible with testmon 65 # Deselect test_bind_addr_unix on darwin because times out 66 # Deselect test_http_over_https_error on darwin because builtin cert fails 67 # Disable warnings-as-errors because of deprecation warnings from socks on python 3.7 68 # Disable pytest-testmon because it doesn't work 69 # adds many other pytest utilities which aren't necessary like linting 70 preCheck = '' 71 rm pytest.ini 72 ''; 73 74 disabledTests = 75 [ 76 "tls" # touches network 77 "peercreds_unix_sock" # test urls no longer allowed 78 ] 79 ++ lib.optionals stdenv.isDarwin [ 80 "http_over_https_error" 81 "bind_addr_unix" 82 "test_ssl_env" 83 ]; 84 85 disabledTestPaths = [ 86 # avoid attempting to use 3 packages not available on nixpkgs 87 # (jaraco.apt, jaraco.context, yg.lockfile) 88 "cheroot/test/test_wsgi.py" 89 # requires pyopenssl 90 "cheroot/test/test_ssl.py" 91 ]; 92 93 pythonImportsCheck = [ "cheroot" ]; 94 95 # Some of the tests use localhost networking. 96 __darwinAllowLocalNetworking = true; 97 98 meta = with lib; { 99 description = "High-performance, pure-Python HTTP"; 100 mainProgram = "cheroot"; 101 homepage = "https://github.com/cherrypy/cheroot"; 102 license = licenses.mit; 103 maintainers = [ ]; 104 }; 105}