Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / streaming-form-data / default.nix
blob18df3a778da2b93e09c24cdc782ad918bef8f879
1 { lib, fetchFromGitHub, buildPythonPackage, pythonOlder,
2 cython, pytestCheckHook, requests-toolbelt }:
4 buildPythonPackage rec {
5   pname = "streaming-form-data";
6   version = "1.13.0";
7   format = "setuptools";
8   disabled = pythonOlder "3.6";
10   src = fetchFromGitHub {
11     owner = "siddhantgoel";
12     repo = "streaming-form-data";
13     rev = "v${version}";
14     hash = "sha256-Ntiad5GZtfRd+2uDPgbDzLBzErGFroffK6ZAmMcsfXA=";
15   };
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.
20   patches = [
21     ./drop-smart-open.patch
22   ];
24   nativeBuildInputs = [ cython ];
26   nativeCheckInputs = [ pytestCheckHook requests-toolbelt ];
28   pytestFlagsArray = [ "tests" ];
30   pythonImportsCheck = [ "streaming_form_data" ];
32   preCheck = ''
33     # remove in-tree copy to make pytest find the installed one, with the native parts already built
34     rm -rf streaming_form_data
35   '';
37   meta = with lib; {
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 ];
42   };