about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/flasgger/default.nix
blob: 1be41854b52ea6ae642db982e6ebedb6a21508d8 (plain) (blame)
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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{ lib
, buildPythonPackage
, fetchFromGitHub
, fetchpatch

# dependencies
, flask
, jsonschema
, mistune
, pyyaml
, six
, werkzeug

# tests
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "flasgger";
  version = "0.9.5";
  format = "setuptools";

  src = fetchFromGitHub {
    owner = "flasgger";
    repo = "flasgger";
    rev = version;
    hash = "sha256-cYFMKZxpi69gVWqyZUltCL0ZwcfIABNsJKqAhN2TTSg=";
  };

  patches = [
    (fetchpatch {
      # flask 2.3 compat
      url = "https://github.com/flasgger/flasgger/commit/ab77be7c6de1d4b361f0eacfa37290239963f890.patch";
      hash = "sha256-ZbE5pPUP23nZAP/qcdeWkwzrZgqJSRES7oFta8U1uVQ=";
    })
    (fetchpatch {
      # python 3.12 compat
      url = "https://github.com/flasgger/flasgger/commit/6f5fcf24c1d816cf7ab529b3a8a764f86df4458d.patch";
      hash = "sha256-37Es1sgBQ9qX3YHQYub4HJkSNTSt3MbtCfV+XdTQZyY=";
    })
  ];

  propagatedBuildInputs = [
    flask
    jsonschema
    mistune
    pyyaml
    six
    werkzeug
  ];

  pythonImportsCheck = [
    "flasgger"
  ];

  nativeCheckInputs = [
    pytestCheckHook
  ];

  doCheck = false; # missing flex dependency

  meta = with lib; {
    description = "Easy OpenAPI specs and Swagger UI for your Flask API";
    homepage = "https://github.com/flasgger/flasgger/";
    license = licenses.mit;
    maintainers = with maintainers; [ ];
  };
}