1{ lib 2, betamax 3, buildPythonPackage 4, fetchpatch 5, fetchPypi 6, mock 7, pyopenssl 8, pytestCheckHook 9, requests 10}: 11 12buildPythonPackage rec { 13 pname = "requests-toolbelt"; 14 version = "0.9.1"; 15 format = "setuptools"; 16 17 src = fetchPypi { 18 inherit pname version; 19 hash = "sha256-loCJ1FhK1K18FxRU8KXG2sI5celHJSHqO21J1hCqb8A="; 20 }; 21 22 propagatedBuildInputs = [ 23 requests 24 ]; 25 26 checkInputs = [ 27 betamax 28 mock 29 pytestCheckHook 30 ]; 31 32 patches = [ 33 (fetchpatch { 34 # Fix collections.abc deprecation warning, https://github.com/requests/toolbelt/pull/246 35 name = "fix-collections-abc-deprecation.patch"; 36 url = "https://github.com/requests/toolbelt/commit/7188b06330e5260be20bce8cbcf0d5ae44e34eaf.patch"; 37 sha256 = "sha256-pRkG77sNglG/KsRX6JaPgk4QxmmSBXypFRp/vNA3ot4="; 38 }) 39 # Make pyopenssl optional 40 (fetchpatch { 41 url = "https://github.com/requests/toolbelt/commit/c7c1f8626b73e5715e6ecc1de0833fabdfd67323.patch"; 42 sha256 = "sha256-OhE3nyYyKKRHs9rCq8EJYebwaYyjWjbvbtL79MIMMRc="; 43 }) 44 # Make pyopenssl optional 45 (fetchpatch { 46 url = "https://github.com/requests/toolbelt/commit/2453f32f1c995e7b19294750a4177bc32326826e.patch"; 47 sha256 = "sha256-qmKHp+aVeazZt8X+sZeYfZCB56SE0OvFvWCXRZtkCew="; 48 }) 49 ]; 50 51 disabledTests = [ 52 # https://github.com/requests/toolbelt/issues/306 53 "test_no_content_length_header" 54 "test_read_file" 55 "test_reads_file_from_url_wrapper" 56 "test_x509_der" 57 "test_x509_pem" 58 ]; 59 60 pythonImportsCheck = [ 61 "requests_toolbelt" 62 ]; 63 64 meta = with lib; { 65 description = "Toolbelt of useful classes and functions to be used with requests"; 66 homepage = "http://toolbelt.rtfd.org"; 67 license = licenses.asl20; 68 maintainers = with maintainers; [ matthiasbeyer ]; 69 }; 70}