1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, click
5, click-default-group
6, sanic
7, jinja2
8, hupper
9, pint
10, pluggy
11, pytest
12, pytestrunner
13, pytest-asyncio
14, black
15, aiohttp
16, beautifulsoup4
17}:
18
19buildPythonPackage rec {
20 pname = "datasette";
21 version = "0.28";
22
23 src = fetchFromGitHub {
24 owner = "simonw";
25 repo = "datasette";
26 rev = version;
27 sha256 = "1m2s03gyq0ghjc3s0b5snpinisddywpgii2f0zqa3v4ljmzanx7h";
28 };
29
30 buildInputs = [ pytestrunner ];
31
32 propagatedBuildInputs = [
33 click
34 click-default-group
35 sanic
36 jinja2
37 hupper
38 pint
39 pluggy
40 ];
41
42 checkInputs = [
43 pytest
44 pytest-asyncio
45 aiohttp
46 beautifulsoup4
47 black
48 ];
49
50 postConfigure = ''
51 substituteInPlace setup.py \
52 --replace "click-default-group==1.2" "click-default-group" \
53 --replace "Sanic==0.7.0" "Sanic" \
54 --replace "hupper==1.0" "hupper" \
55 --replace "pint==0.8.1" "pint" \
56 --replace "Jinja2==2.10.1" "Jinja2"
57 '';
58
59 # many tests require network access
60 checkPhase = ''
61 pytest --ignore tests/test_api.py \
62 --ignore tests/test_csv.py \
63 --ignore tests/test_html.py
64 '';
65
66 meta = with lib; {
67 description = "An instant JSON API for your SQLite databases";
68 homepage = https://github.com/simonw/datasette;
69 license = licenses.asl20;
70 maintainers = [ maintainers.costrouc ];
71 };
72
73}