1 { lib, fetchFromGitHub, buildPythonPackage, pythonOlder,
2 cython, pytestCheckHook, requests-toolbelt }:
4 buildPythonPackage rec {
5 pname = "streaming-form-data";
8 disabled = pythonOlder "3.6";
10 src = fetchFromGitHub {
11 owner = "siddhantgoel";
12 repo = "streaming-form-data";
14 hash = "sha256-Ntiad5GZtfRd+2uDPgbDzLBzErGFroffK6ZAmMcsfXA=";
17 # streaming-form-data has a small bit of code that uses smart_open, which has a massive closure.
18 # The only consumer of streaming-form-data is Moonraker, which doesn't use that code.
19 # So, just drop the dependency to not have to deal with it.
21 ./drop-smart-open.patch
24 nativeBuildInputs = [ cython ];
26 nativeCheckInputs = [ pytestCheckHook requests-toolbelt ];
28 pytestFlagsArray = [ "tests" ];
30 pythonImportsCheck = [ "streaming_form_data" ];
33 # remove in-tree copy to make pytest find the installed one, with the native parts already built
34 rm -rf streaming_form_data
38 description = "Streaming parser for multipart/form-data";
39 homepage = "https://github.com/siddhantgoel/streaming-form-data";
40 license = licenses.mit;
41 maintainers = with maintainers; [ zhaofengli ];