summary refs log tree commit diff
path: root/pkgs/development/python-modules/aiohttp-swagger/default.nix
blob: a8e3499ee58443d9a73b86cddb9152f455b0a42a (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
{ lib
, buildPythonPackage
, fetchFromGitHub
, aiohttp
, jinja2
, markupsafe
, pytest-aiohttp
, pytestCheckHook
, pythonOlder
, pyyaml
}:

buildPythonPackage rec {
  pname = "aiohttp-swagger";
  version = "1.0.15";
  format = "setuptools";

  disabled = pythonOlder "3.6";

  src = fetchFromGitHub {
    owner = "cr0hn";
    repo = pname;
    rev = version;
    hash = "sha256-M43sNpbXWXFRTd549cZhvhO35nBB6OH+ki36BzSk87Q=";
  };

  propagatedBuildInputs = [
    aiohttp
    jinja2
    markupsafe
    pyyaml
  ];

  checkInputs = [
    pytestCheckHook
    pytest-aiohttp
  ];

  postPatch = ''
    substituteInPlace requirements.txt \
      --replace "markupsafe~=1.1.1" "markupsafe>=1.1.1" \
      --replace "jinja2~=2.11.2" "jinja2>=2.11.2"
  '';

  preCheck = ''
    # The custom client is obsolete
    rm tests/conftest.py
  '';

  pythonImportsCheck = [
    "aiohttp_swagger"
  ];

  meta = with lib; {
    description = "Swagger API Documentation builder for aiohttp";
    homepage = "https://github.com/cr0hn/aiohttp-swagger";
    license = licenses.mit;
    maintainers = with maintainers; [ elohmeier ];
  };
}