2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
|
|
|
, pydantic
|
2021-01-09 10:05:03 +00:00
|
|
|
, starlette
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-asyncio
|
2020-04-24 23:36:52 +00:00
|
|
|
, aiosqlite
|
2021-01-09 10:05:03 +00:00
|
|
|
, databases
|
2020-04-24 23:36:52 +00:00
|
|
|
, flask
|
2021-01-09 10:05:03 +00:00
|
|
|
, httpx
|
|
|
|
, passlib
|
|
|
|
, peewee
|
|
|
|
, python-jose
|
|
|
|
, sqlalchemy
|
2021-10-09 14:59:57 +00:00
|
|
|
, trio
|
2022-01-03 16:56:52 +00:00
|
|
|
, pythonOlder
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "fastapi";
|
2022-01-13 20:06:32 +00:00
|
|
|
version = "0.71.0";
|
2020-04-24 23:36:52 +00:00
|
|
|
format = "flit";
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tiangolo";
|
2022-01-03 16:56:52 +00:00
|
|
|
repo = pname;
|
2020-04-24 23:36:52 +00:00
|
|
|
rev = version;
|
2022-01-13 20:06:32 +00:00
|
|
|
sha256 = "sha256-J4j7lQm22pbwfMkQGF1s2xyFU4MCwXrAqDmRJmLmKGg=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
propagatedBuildInputs = [
|
|
|
|
starlette
|
|
|
|
pydantic
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
aiosqlite
|
2021-01-09 10:05:03 +00:00
|
|
|
databases
|
2020-04-24 23:36:52 +00:00
|
|
|
flask
|
2021-01-09 10:05:03 +00:00
|
|
|
httpx
|
|
|
|
passlib
|
|
|
|
peewee
|
|
|
|
python-jose
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-asyncio
|
|
|
|
sqlalchemy
|
2021-10-09 14:59:57 +00:00
|
|
|
trio
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "starlette ==" "starlette >="
|
|
|
|
'';
|
2021-07-24 12:14:16 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
pytestFlagsArray = [
|
2022-01-03 16:56:52 +00:00
|
|
|
# ignoring deprecation warnings to avoid test failure from
|
|
|
|
# tests/test_tutorial/test_testing/test_tutorial001.py
|
2021-09-18 10:52:07 +00:00
|
|
|
"-W ignore::DeprecationWarning"
|
|
|
|
];
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Disabled tests require orjson which requires rust nightly
|
|
|
|
"tests/test_default_response_class.py"
|
2022-01-13 20:06:32 +00:00
|
|
|
# Don't test docs and examples
|
|
|
|
"docs_src"
|
2022-01-03 16:56:52 +00:00
|
|
|
];
|
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
disabledTests = [
|
|
|
|
"test_get_custom_response"
|
|
|
|
|
|
|
|
# Failed: DID NOT RAISE <class 'starlette.websockets.WebSocketDisconnect'>
|
|
|
|
"test_websocket_invalid_data"
|
|
|
|
"test_websocket_no_credentials"
|
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"fastapi"
|
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2022-01-03 16:56:52 +00:00
|
|
|
description = "Web framework for building APIs";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/tiangolo/fastapi";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ wd15 ];
|
|
|
|
};
|
|
|
|
}
|