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