1{
2 lib,
3 brotli,
4 buildPythonPackage,
5 certifi,
6 dpkt,
7 fetchFromGitHub,
8 gevent,
9 llhttp,
10 pytestCheckHook,
11 pythonOlder,
12 setuptools,
13 six,
14 stdenv,
15 urllib3,
16}:
17
18buildPythonPackage rec {
19 pname = "geventhttpclient";
20 version = "2.3.1";
21 pyproject = true;
22
23 disabled = pythonOlder "3.6";
24
25 src = fetchFromGitHub {
26 owner = "geventhttpclient";
27 repo = "geventhttpclient";
28 rev = "refs/tags/${version}";
29 # TODO: unvendor llhttp
30 fetchSubmodules = true;
31 hash = "sha256-uOGnwPbvTam14SFTUT0UrwxHfP4a5cn3a7EhLoGBUrA=";
32 };
33
34 build-system = [ setuptools ];
35
36 dependencies = [
37 brotli
38 certifi
39 gevent
40 urllib3
41 ];
42
43 nativeCheckInputs = [
44 dpkt
45 pytestCheckHook
46 ];
47
48 # lots of: [Errno 48] Address already in use: ('127.0.0.1', 54323)
49 doCheck = !stdenv.isDarwin;
50
51 __darwinAllowLocalNetworking = true;
52
53 preCheck = ''
54 rm -rf geventhttpclient
55 '';
56
57 pytestFlagsArray = [ "-m 'not network'" ];
58
59 pythonImportsCheck = [ "geventhttpclient" ];
60
61 meta = with lib; {
62 homepage = "https://github.com/geventhttpclient/geventhttpclient";
63 description = "High performance, concurrent HTTP client library using gevent";
64 changelog = "https://github.com/geventhttpclient/geventhttpclient/releases/tag/${version}";
65 license = licenses.mit;
66 maintainers = with maintainers; [ koral ];
67 };
68}