summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/streaming-form-data/default.nix
blob: ff39dfd30def8605a61ed63c8ca2ffa01116dfc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
{
  lib,
  fetchFromGitHub,
  buildPythonPackage,
  cython,
  setuptools,
  pytestCheckHook,
  requests-toolbelt,
}:

buildPythonPackage rec {
  pname = "streaming-form-data";
  version = "1.19.1";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "siddhantgoel";
    repo = "streaming-form-data";
    tag = "v${version}";
    hash = "sha256-3tK7dX5p1uH/azmFxzELM1bflGI/SHoLvsw+Ta+7rC4=";
  };

  # streaming-form-data has a small bit of code that uses smart_open, which has a massive closure.
  # The only consumer of streaming-form-data is Moonraker, which doesn't use that code.
  # So, just drop the dependency to not have to deal with it.
  patches = [ ./drop-smart-open.patch ];

  build-system = [
    cython
    setuptools
  ];

  nativeCheckInputs = [
    pytestCheckHook
    requests-toolbelt
  ];

  enabledTestPaths = [ "tests" ];

  pythonImportsCheck = [ "streaming_form_data" ];

  meta = {
    description = "Streaming parser for multipart/form-data";
    homepage = "https://github.com/siddhantgoel/streaming-form-data";
    changelog = "https://github.com/siddhantgoel/streaming-form-data/blob/${src.tag}/CHANGELOG.md";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ zhaofengli ];
  };
}