2019-07-26 17:15:36 +01:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2019-12-29 18:08:35 +00:00
|
|
|
, fetchFromGitHub
|
2019-07-26 17:15:36 +01:00
|
|
|
, uvicorn
|
|
|
|
, starlette
|
|
|
|
, pydantic
|
|
|
|
, isPy3k
|
2019-12-29 18:08:35 +00:00
|
|
|
, pytest
|
|
|
|
, pytestcov
|
|
|
|
, pyjwt
|
|
|
|
, passlib
|
|
|
|
, aiosqlite
|
2020-02-28 16:36:20 +00:00
|
|
|
, peewee
|
2020-04-07 19:02:51 +01:00
|
|
|
, flask
|
2019-07-26 17:15:36 +01:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "fastapi";
|
2020-05-11 19:43:40 +01:00
|
|
|
version = "0.54.1";
|
2019-12-29 18:08:35 +00:00
|
|
|
format = "flit";
|
2019-07-26 17:15:36 +01:00
|
|
|
disabled = !isPy3k;
|
|
|
|
|
2019-12-29 18:08:35 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tiangolo";
|
|
|
|
repo = "fastapi";
|
|
|
|
rev = version;
|
2020-05-11 19:43:40 +01:00
|
|
|
sha256 = "0k0lss8x6lzf0szcli48v28r269fsx1jdkr9q78liz47dz5x03d8";
|
2019-07-26 17:15:36 +01:00
|
|
|
};
|
|
|
|
|
2020-05-11 19:43:40 +01:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "starlette ==0.13.2" "starlette"
|
|
|
|
'';
|
|
|
|
|
2019-07-26 17:15:36 +01:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
uvicorn
|
|
|
|
starlette
|
|
|
|
pydantic
|
|
|
|
];
|
|
|
|
|
2019-12-29 18:08:35 +00:00
|
|
|
checkInputs = [
|
|
|
|
pytest
|
|
|
|
pytestcov
|
|
|
|
pyjwt
|
|
|
|
passlib
|
|
|
|
aiosqlite
|
2020-02-28 16:36:20 +00:00
|
|
|
peewee
|
2020-04-07 19:02:51 +01:00
|
|
|
flask
|
2019-12-29 18:08:35 +00:00
|
|
|
];
|
|
|
|
|
2020-04-07 19:02:51 +01:00
|
|
|
# test_default_response_class.py: requires orjson, which requires rust toolchain
|
|
|
|
# test_custom_response/test_tutorial001b.py: requires orjson
|
|
|
|
# tests/test_tutorial/test_sql_databases/test_testing_databases.py: just broken, don't know why
|
2019-07-26 17:15:36 +01:00
|
|
|
checkPhase = ''
|
2020-04-07 19:02:51 +01:00
|
|
|
pytest --ignore=tests/test_default_response_class.py \
|
|
|
|
--ignore=tests/test_tutorial/test_custom_response/test_tutorial001b.py \
|
|
|
|
--ignore=tests/test_tutorial/test_sql_databases/test_testing_databases.py
|
2019-07-26 17:15:36 +01:00
|
|
|
'';
|
|
|
|
|
|
|
|
meta = with lib; {
|
|
|
|
homepage = "https://github.com/tiangolo/fastapi";
|
|
|
|
description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ wd15 ];
|
|
|
|
};
|
|
|
|
}
|