1{ lib, fetchFromGitHub, buildPythonPackage, pythonOlder, 2cython, smart-open, pytestCheckHook, moto, requests-toolbelt }: 3 4buildPythonPackage rec { 5 pname = "streaming-form-data"; 6 version = "1.13.0"; 7 disabled = pythonOlder "3.6"; 8 9 src = fetchFromGitHub { 10 owner = "siddhantgoel"; 11 repo = "streaming-form-data"; 12 rev = "v${version}"; 13 hash = "sha256-Ntiad5GZtfRd+2uDPgbDzLBzErGFroffK6ZAmMcsfXA="; 14 }; 15 16 nativeBuildInputs = [ cython ]; 17 18 propagatedBuildInputs = [ smart-open ]; 19 20 nativeCheckInputs = [ pytestCheckHook moto requests-toolbelt ]; 21 22 pytestFlagsArray = [ "tests" ]; 23 24 pythonImportsCheck = [ "streaming_form_data" ]; 25 26 preCheck = '' 27 # remove in-tree copy to make pytest find the installed one, with the native parts already built 28 rm -rf streaming_form_data 29 ''; 30 31 meta = with lib; { 32 description = "Streaming parser for multipart/form-data"; 33 homepage = "https://github.com/siddhantgoel/streaming-form-data"; 34 license = licenses.mit; 35 maintainers = with maintainers; [ zhaofengli ]; 36 }; 37}