1{ lib, buildPythonPackage, fetchPypi, pytest, fetchpatch }:
2
3buildPythonPackage rec {
4 pname = "h11";
5 version = "0.9.0";
6
7 src = fetchPypi {
8 inherit pname version;
9 sha256 = "1qfad70h59hya21vrzz8dqyyaiqhac0anl2dx3s3k80gpskvrm1k";
10 };
11
12 patches = [
13 # pytest5 compatability
14 (fetchpatch {
15 url = https://github.com/python-hyper/h11/commit/241e220493a511a5f5a5d472cb88d72661a92ab1.patch;
16 sha256 = "1s3ipf9s41m1lksws3xv3j133q7jnjdqvmgk4sfnm8q7li2dww39";
17 })
18 ];
19
20 checkInputs = [ pytest ];
21
22 checkPhase = ''
23 py.test
24 '';
25
26 # Some of the tests use localhost networking.
27 __darwinAllowLocalNetworking = true;
28
29 meta = with lib; {
30 description = "Pure-Python, bring-your-own-I/O implementation of HTTP/1.1";
31 license = licenses.mit;
32 };
33}