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