1{ 2 lib, 3 aniso8601, 4 blinker, 5 buildPythonPackage, 6 fetchPypi, 7 flask, 8 fetchpatch2, 9 mock, 10 pytest8_3CheckHook, 11 pythonOlder, 12 pytz, 13 six, 14 werkzeug, 15}: 16 17buildPythonPackage rec { 18 pname = "flask-restful"; 19 version = "0.3.10"; 20 format = "setuptools"; 21 22 disabled = pythonOlder "3.7"; 23 24 src = fetchPypi { 25 pname = "Flask-RESTful"; 26 inherit version; 27 hash = "sha256-/kry7wAn34+bT3l6uiDFVmgBtq3plaxjtYir8aWc7Dc="; 28 }; 29 30 # conditional so that overrides are easier for web applications 31 patches = 32 lib.optionals (lib.versionAtLeast werkzeug.version "2.1.0") [ ./werkzeug-2.1.0-compat.patch ] 33 ++ lib.optionals (lib.versionAtLeast flask.version "3.0.0") [ ./flask-3.0-compat.patch ] 34 ++ [ 35 # replace use nose by pytest: https://github.com/flask-restful/flask-restful/pull/970 36 (fetchpatch2 { 37 url = "https://github.com/flask-restful/flask-restful/commit/6cc4b057e5450e0c84b3ee5f6f7a97e648a816d6.patch?full_index=1"; 38 hash = "sha256-kIjrkyL0OfX+gjoiYfchU0QYTPHz4JMCQcHLFH9oEF4="; 39 }) 40 ./fix-test-inputs.patch 41 ]; 42 43 propagatedBuildInputs = [ 44 aniso8601 45 flask 46 pytz 47 six 48 ]; 49 50 nativeCheckInputs = [ 51 blinker 52 mock 53 pytest8_3CheckHook 54 ]; 55 56 disabledTests = [ 57 # Broke in flask 2.2 upgrade 58 "test_exception_header_forwarded" 59 # Broke in werkzeug 2.3 upgrade 60 "test_media_types_method" 61 "test_media_types_q" 62 # time shenanigans 63 "test_iso8601_date_field_with_offset" 64 "test_rfc822_date_field_with_offset" 65 ]; 66 67 pythonImportsCheck = [ "flask_restful" ]; 68 69 meta = with lib; { 70 description = "Framework for creating REST APIs"; 71 homepage = "https://flask-restful.readthedocs.io"; 72 longDescription = '' 73 Flask-RESTful provides the building blocks for creating a great 74 REST API. 75 ''; 76 license = licenses.bsd3; 77 maintainers = [ ]; 78 }; 79}