1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 aiofiles,
6 asgi-csrf,
7 click,
8 click-default-group,
9 flexcache,
10 flexparser,
11 httpx,
12 hupper,
13 itsdangerous,
14 janus,
15 jinja2,
16 mergedeep,
17 platformdirs,
18 pluggy,
19 pyyaml,
20 typing-extensions,
21 uvicorn,
22 pytestCheckHook,
23 pytest-asyncio,
24 pytest-timeout,
25 aiohttp,
26 beautifulsoup4,
27 asgiref,
28 setuptools,
29 trustme,
30 pythonOlder,
31}:
32
33buildPythonPackage rec {
34 pname = "datasette";
35 version = "0.65.1";
36 pyproject = true;
37
38 disabled = pythonOlder "3.8";
39
40 src = fetchFromGitHub {
41 owner = "simonw";
42 repo = pname;
43 tag = version;
44 hash = "sha256-kVtldBuDy19DmyxEQLtAjs1qiNIjaT8+rnHlFfGNHec=";
45 };
46
47 postPatch = ''
48 substituteInPlace setup.py \
49 --replace '"pytest-runner"' ""
50 '';
51
52 build-system = [ setuptools ];
53
54 pythonRemoveDeps = [
55 "pip"
56 "setuptools"
57 ];
58
59 dependencies = [
60 aiofiles
61 asgi-csrf
62 asgiref
63 click
64 click-default-group
65 flexcache
66 flexparser
67 httpx
68 hupper
69 itsdangerous
70 janus
71 jinja2
72 mergedeep
73 platformdirs
74 pluggy
75 pyyaml
76 setuptools
77 typing-extensions
78 uvicorn
79 ];
80
81 nativeCheckInputs = [
82 aiohttp
83 beautifulsoup4
84 pytest-asyncio
85 pytest-timeout
86 pytestCheckHook
87 trustme
88 ];
89
90 # takes 30-180 mins to run entire test suite, not worth the CPU resources, slows down reviews
91 # with pytest-xdist, it still takes around 10 mins with 32 cores
92 # just run the csv tests, as this should give some indictation of correctness
93 pytestFlagsArray = [
94 # datasette/app.py:14: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
95 "-W"
96 "ignore::DeprecationWarning"
97 "tests/test_csv.py"
98 ];
99
100 disabledTests = [
101 "facet"
102 "_invalid_database" # checks error message when connecting to invalid database
103 ];
104
105 pythonImportsCheck = [
106 "datasette"
107 "datasette.cli"
108 "datasette.app"
109 "datasette.database"
110 "datasette.renderer"
111 "datasette.tracer"
112 "datasette.plugins"
113 ];
114
115 meta = with lib; {
116 description = "Multi-tool for exploring and publishing data";
117 mainProgram = "datasette";
118 homepage = "https://datasette.io/";
119 changelog = "https://github.com/simonw/datasette/releases/tag/${version}";
120 license = licenses.asl20;
121 maintainers = [ ];
122 };
123}