1{ lib
2, buildPythonPackage
3, fetchPypi
4, httptools
5, aiofiles
6, websockets
7, multidict
8, uvloop
9, ujson
10, pytest
11, gunicorn
12, pytestcov
13, aiohttp
14, beautifulsoup4
15, pytest-sanic
16, pytest-sugar
17, pytest-benchmark
18}:
19
20buildPythonPackage rec {
21 pname = "sanic";
22 version = "19.3.1";
23
24 src = fetchPypi {
25 inherit pname version;
26 sha256 = "ce434eb154872ca64493a6c3a288f11fd10bca0de7be7bf9f1d0d063185e51ec";
27 };
28
29 propagatedBuildInputs = [
30 httptools
31 aiofiles
32 websockets
33 multidict
34 uvloop
35 ujson
36 ];
37
38 checkInputs = [
39 pytest
40 gunicorn
41 pytestcov
42 aiohttp
43 beautifulsoup4
44 pytest-sanic
45 pytest-sugar
46 pytest-benchmark
47 ];
48
49 postConfigure = ''
50 substituteInPlace setup.py \
51 --replace "websockets>=6.0,<7.0" "websockets"
52 '';
53
54 # 10/500 tests ignored due to missing directory and
55 # requiring network access
56 checkPhase = ''
57 pytest --ignore tests/test_blueprints.py \
58 --ignore tests/test_routes.py \
59 --ignore tests/test_worker.py
60 '';
61
62 meta = with lib; {
63 description = "A microframework based on uvloop, httptools, and learnings of flask";
64 homepage = http://github.com/channelcat/sanic/;
65 license = licenses.mit;
66 maintainers = [ maintainers.costrouc ];
67 };
68}