aboutsummaryrefslogtreecommitdiff
path: root/nixpkgs/pkgs/development/python-modules/sanic/default.nix
blob: 6aae4c11fdd42f3909209edbdd5ec6a28f3a94e0 (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
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
{ lib
, buildPythonPackage
, fetchPypi
, httptools
, aiofiles
, websockets
, multidict
, uvloop
, ujson
, pytest
, gunicorn
, pytestcov
, aiohttp
, beautifulsoup4
, pytest-sanic
, pytest-sugar
, pytest-benchmark
}:

buildPythonPackage rec {
  pname = "sanic";
  version = "19.3.1";

  src = fetchPypi {
    inherit pname version;
    sha256 = "ce434eb154872ca64493a6c3a288f11fd10bca0de7be7bf9f1d0d063185e51ec";
  };

  propagatedBuildInputs = [
    httptools
    aiofiles
    websockets
    multidict
    uvloop
    ujson
  ];

  checkInputs = [
    pytest
    gunicorn
    pytestcov
    aiohttp
    beautifulsoup4
    pytest-sanic
    pytest-sugar
    pytest-benchmark
  ];

  postConfigure = ''
    substituteInPlace setup.py \
      --replace "websockets>=6.0,<7.0" "websockets"
  '';

  # 10/500 tests ignored due to missing directory and
  # requiring network access
  checkPhase = ''
    pytest --ignore tests/test_blueprints.py \
           --ignore tests/test_routes.py \
           --ignore tests/test_worker.py
  '';

  meta = with lib; {
    description = "A microframework based on uvloop, httptools, and learnings of flask";
    homepage = http://github.com/channelcat/sanic/;
    license = licenses.mit;
    maintainers = [ maintainers.costrouc ];
  };
}