nixpkgs/pkgs/development/python-modules/datasette/default.nix

94 lines
1.9 KiB
Nix
Raw Normal View History

2019-05-07 13:52:16 +01:00
{ lib
, buildPythonPackage
, fetchFromGitHub
2020-04-03 19:12:50 +01:00
, aiofiles
2019-05-07 13:52:16 +01:00
, click
, click-default-group
2020-04-03 19:12:50 +01:00
, janus
2019-05-07 13:52:16 +01:00
, jinja2
, hupper
, pint
, pluggy
2020-04-03 19:12:50 +01:00
, uvicorn
# Check Inputs
, pytestCheckHook
2019-05-07 13:52:16 +01:00
, pytestrunner
, pytest-asyncio
2019-05-31 15:07:32 +01:00
, black
2019-05-07 13:52:16 +01:00
, aiohttp
, beautifulsoup4
, asgiref
2019-05-07 13:52:16 +01:00
}:
buildPythonPackage rec {
pname = "datasette";
2020-04-03 19:12:50 +01:00
version = "0.39";
2019-05-07 13:52:16 +01:00
src = fetchFromGitHub {
owner = "simonw";
repo = "datasette";
2019-05-07 13:52:16 +01:00
rev = version;
2020-04-03 19:12:50 +01:00
sha256 = "07d46512bc9sdan9lv39sf1bwlf7vf1bfhcsm825vk7sv7g9kczd";
2019-05-07 13:52:16 +01:00
};
nativeBuildInputs = [ pytestrunner ];
2019-05-07 13:52:16 +01:00
propagatedBuildInputs = [
2020-04-03 19:12:50 +01:00
aiofiles
2019-05-07 13:52:16 +01:00
click
click-default-group
2020-04-03 19:12:50 +01:00
janus
2019-05-07 13:52:16 +01:00
jinja2
hupper
pint
pluggy
uvicorn
2019-05-07 13:52:16 +01:00
];
checkInputs = [
2020-04-03 19:12:50 +01:00
pytestCheckHook
2019-05-07 13:52:16 +01:00
pytest-asyncio
aiohttp
beautifulsoup4
2019-05-31 15:07:32 +01:00
black
asgiref
2019-05-07 13:52:16 +01:00
];
postConfigure = ''
substituteInPlace setup.py \
2020-04-03 19:12:50 +01:00
--replace "click~=7.1.1" "click" \
--replace "click-default-group~=1.2.2" "click-default-group" \
--replace "Jinja2~=2.10.3" "Jinja2" \
--replace "hupper~=1.9" "hupper" \
--replace "pint~=0.9" "pint" \
--replace "pluggy~=0.13.0" "pint" \
--replace "uvicorn~=0.11" "uvicorn" \
--replace "aiofiles~=0.4.0" "aiofiles" \
--replace "janus~=0.4.0" "janus" \
--replace "PyYAML~=5.3" "PyYAML"
2019-05-07 13:52:16 +01:00
'';
# many tests require network access
# test_black fails on darwin
2020-04-03 19:12:50 +01:00
dontUseSetuptoolsCheck = true;
pytestFlagsArray = [
"--ignore=tests/test_api.py"
"--ignore=tests/test_csv.py"
"--ignore=tests/test_html.py"
"--ignore=tests/test_docs.py"
"--ignore=tests/test_black.py"
];
disabledTests = [
"facet"
"_invalid_database" # checks error message when connecting to invalid database
];
2019-05-07 13:52:16 +01:00
meta = with lib; {
description = "An instant JSON API for your SQLite databases";
homepage = https://github.com/simonw/datasette;
license = licenses.asl20;
maintainers = [ maintainers.costrouc ];
};
}