2021-08-05 21:33:18 +00:00
|
|
|
{ lib, fetchFromGitHub, buildPythonPackage, pythonOlder,
|
2023-11-16 04:20:00 +00:00
|
|
|
cython, smart-open, pytestCheckHook, moto, requests-toolbelt }:
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "streaming-form-data";
|
2023-11-16 04:20:00 +00:00
|
|
|
version = "1.13.0";
|
2021-08-05 21:33:18 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "siddhantgoel";
|
|
|
|
repo = "streaming-form-data";
|
|
|
|
rev = "v${version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
hash = "sha256-Ntiad5GZtfRd+2uDPgbDzLBzErGFroffK6ZAmMcsfXA=";
|
2021-08-05 21:33:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
nativeBuildInputs = [ cython ];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
propagatedBuildInputs = [ smart-open ];
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
nativeCheckInputs = [ pytestCheckHook moto requests-toolbelt ];
|
2021-08-05 21:33:18 +00:00
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
pytestFlagsArray = [ "tests" ];
|
2021-08-05 21:33:18 +00:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "streaming_form_data" ];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
preCheck = ''
|
|
|
|
# remove in-tree copy to make pytest find the installed one, with the native parts already built
|
|
|
|
rm -rf streaming_form_data
|
|
|
|
'';
|
|
|
|
|
2021-08-05 21:33:18 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "Streaming parser for multipart/form-data";
|
|
|
|
homepage = "https://github.com/siddhantgoel/streaming-form-data";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ zhaofengli ];
|
|
|
|
};
|
|
|
|
}
|