Clone of https://github.com/NixOS/nixpkgs.git (to stress-test knotserver)
at 21.05 106 lines 2.1 kB view raw
1{ lib 2, buildPythonPackage 3, fetchFromGitHub 4, aiofiles 5, asgi-csrf 6, click 7, click-default-group 8, janus 9, jinja2 10, hupper 11, mergedeep 12, pint 13, pluggy 14, python-baseconv 15, pyyaml 16, uvicorn 17, httpx 18# Check Inputs 19, pytestCheckHook 20, pytestrunner 21, pytest-asyncio 22, aiohttp 23, beautifulsoup4 24, asgiref 25, setuptools 26}: 27 28buildPythonPackage rec { 29 pname = "datasette"; 30 version = "0.54.1"; 31 32 src = fetchFromGitHub { 33 owner = "simonw"; 34 repo = "datasette"; 35 rev = version; 36 sha256 = "sha256-Ixh56X9dI/FIJPXHXXGnFiYj3qeBmvW5L1FF7/0ofUQ="; 37 }; 38 39 nativeBuildInputs = [ pytestrunner ]; 40 41 propagatedBuildInputs = [ 42 aiofiles 43 asgi-csrf 44 click 45 click-default-group 46 janus 47 jinja2 48 hupper 49 mergedeep 50 pint 51 pluggy 52 python-baseconv 53 pyyaml 54 uvicorn 55 setuptools 56 httpx 57 asgiref 58 ]; 59 60 checkInputs = [ 61 pytestCheckHook 62 pytest-asyncio 63 aiohttp 64 beautifulsoup4 65 ]; 66 67 postConfigure = '' 68 substituteInPlace setup.py \ 69 --replace "click~=7.1.1" "click" \ 70 --replace "click-default-group~=1.2.2" "click-default-group" \ 71 --replace "hupper~=1.9" "hupper" \ 72 --replace "pint~=0.9" "pint" \ 73 --replace "pluggy~=0.13.0" "pluggy" \ 74 --replace "uvicorn~=0.11" "uvicorn" \ 75 --replace "PyYAML~=5.3" "PyYAML" 76 ''; 77 78 # takes 30-180 mins to run entire test suite, not worth the cpu resources, slows down reviews 79 # with pytest-xdist, it still takes around 10mins with 32 cores 80 # just run the csv tests, as this should give some indictation of correctness 81 pytestFlagsArray = [ 82 "tests/test_csv.py" 83 ]; 84 disabledTests = [ 85 "facet" 86 "_invalid_database" # checks error message when connecting to invalid database 87 ]; 88 89 pythonImportsCheck = [ 90 "datasette" 91 "datasette.cli" 92 "datasette.app" 93 "datasette.database" 94 "datasette.renderer" 95 "datasette.tracer" 96 "datasette.plugins" 97 ]; 98 99 meta = with lib; { 100 description = "An instant JSON API for your SQLite databases"; 101 homepage = "https://github.com/simonw/datasette"; 102 license = licenses.asl20; 103 maintainers = [ maintainers.costrouc ]; 104 }; 105 106}