1{ lib
2, buildPythonPackage
3, pythonOlder
4, fetchPypi
5, fetchpatch
6, hpack
7, hyperframe
8, pytestCheckHook
9, hypothesis
10}:
11
12buildPythonPackage rec {
13 pname = "h2";
14 version = "4.1.0";
15 format = "setuptools";
16
17 disabled = pythonOlder "3.6";
18
19 src = fetchPypi {
20 inherit pname version;
21 hash = "sha256-qDrKCPvnqst5/seIycC6yTY0NWDtnsGLgqE6EsKNKrs=";
22 };
23
24 patches = [
25 # https://github.com/python-hyper/h2/pull/1274
26 (fetchpatch {
27 name = "fix-tests-in-python-3.11.patch";
28 url = "https://github.com/python-hyper/h2/commit/8952c91606cd014720ccf202a25b5ee1fbed1591.patch";
29 hash = "sha256-skAdAVHMZo1xJEqqKa6FOKPvoQQbGUgGsQjE11jIjtw=";
30 })
31 ];
32
33 propagatedBuildInputs = [
34 hpack
35 hyperframe
36 ];
37
38 nativeCheckInputs = [
39 pytestCheckHook
40 hypothesis
41 ];
42
43 disabledTests = [
44 # timing sensitive
45 "test_changing_max_frame_size"
46 ];
47
48 pythonImportsCheck = [
49 "h2.connection"
50 "h2.config"
51 ];
52
53 meta = with lib; {
54 description = "HTTP/2 State-Machine based protocol implementation";
55 homepage = "https://github.com/python-hyper/h2";
56 license = licenses.mit;
57 maintainers = with maintainers; [ ];
58 };
59}