2020-12-09 12:39:15 +00:00
|
|
|
{ lib, buildPythonPackage, fetchPypi
|
|
|
|
, aiofiles, httptools, httpx, multidict, ujson, uvloop, websockets
|
|
|
|
, pytestCheckHook, beautifulsoup4, gunicorn, httpcore, uvicorn
|
|
|
|
, pytest-asyncio, pytest-benchmark, pytest-dependency, pytest-sanic, pytest-sugar, pytestcov
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "sanic";
|
2020-12-09 12:39:15 +00:00
|
|
|
version = "20.9.1";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchPypi {
|
|
|
|
inherit pname version;
|
2020-12-09 12:39:15 +00:00
|
|
|
sha256 = "06p0lsxqbfbka2yaqlpp0bg5pf7ma44zi6kq7qbb6hhry48dp1w6";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2020-12-09 12:39:15 +00:00
|
|
|
patchPhase = ''
|
|
|
|
substituteInPlace setup.py \
|
|
|
|
--replace '"multidict==5.0.0"' '"multidict"' \
|
|
|
|
--replace '"httpx==0.15.4"' '"httpx"' \
|
|
|
|
--replace '"httpcore==0.3.0"' '"httpcore"' \
|
|
|
|
--replace '"pytest==5.2.1"' '"pytest"'
|
|
|
|
'';
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
2020-12-09 12:39:15 +00:00
|
|
|
aiofiles httptools httpx multidict ujson uvloop websockets
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
2020-12-09 12:39:15 +00:00
|
|
|
pytestCheckHook beautifulsoup4 gunicorn httpcore uvicorn
|
|
|
|
pytest-asyncio pytest-benchmark pytest-dependency pytest-sanic pytest-sugar pytestcov
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2020-12-09 12:39:15 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_gunicorn" # No "examples" directory in pypi distribution.
|
|
|
|
"test_logo" # Fails to filter out "DEBUG asyncio:selector_events.py:59 Using selector: EpollSelector"
|
|
|
|
"test_zero_downtime" # No "examples.delayed_response.app" module in pypi distribution.
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-01-09 10:05:03 +00:00
|
|
|
__darwinAllowLocalNetworking = true;
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
|
|
|
description = "A microframework based on uvloop, httptools, and learnings of flask";
|
|
|
|
homepage = "http://github.com/channelcat/sanic/";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = [ maintainers.costrouc ];
|
|
|
|
};
|
|
|
|
}
|