2019-07-26 18:15:36 +02:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
2019-12-29 19:08:35 +01:00
|
|
|
, fetchFromGitHub
|
2019-07-26 18:15:36 +02:00
|
|
|
, pydantic
|
2021-01-04 10:36:49 +01:00
|
|
|
, starlette
|
|
|
|
, pytestCheckHook
|
|
|
|
, pytest-asyncio
|
2019-12-29 19:08:35 +01:00
|
|
|
, aiosqlite
|
2021-01-04 10:36:49 +01:00
|
|
|
, databases
|
2020-04-07 20:02:51 +02:00
|
|
|
, flask
|
2021-01-04 10:36:49 +01:00
|
|
|
, httpx
|
|
|
|
, passlib
|
|
|
|
, peewee
|
|
|
|
, python-jose
|
|
|
|
, sqlalchemy
|
2021-10-08 18:10:25 +02:00
|
|
|
, trio
|
2022-01-01 17:16:44 +01:00
|
|
|
, pythonOlder
|
2019-07-26 18:15:36 +02:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "fastapi";
|
2022-06-05 22:23:08 +02:00
|
|
|
version = "0.78.0";
|
2019-12-29 19:08:35 +01:00
|
|
|
format = "flit";
|
2019-07-26 18:15:36 +02:00
|
|
|
|
2022-01-01 17:16:44 +01:00
|
|
|
disabled = pythonOlder "3.6";
|
|
|
|
|
2019-12-29 19:08:35 +01:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tiangolo";
|
2022-01-01 17:16:44 +01:00
|
|
|
repo = pname;
|
2019-12-29 19:08:35 +01:00
|
|
|
rev = version;
|
2022-06-05 22:23:08 +02:00
|
|
|
hash = "sha256-4JS0VLVg67O7VdcDw2k2u+98kiCdCHvCAEGHYGWEIOA=";
|
2019-07-26 18:15:36 +02:00
|
|
|
};
|
|
|
|
|
2022-06-05 22:23:08 +02:00
|
|
|
postPatch = ''
|
|
|
|
substituteInPlace pyproject.toml \
|
|
|
|
--replace "starlette==" "starlette>="
|
|
|
|
'';
|
|
|
|
|
2019-07-26 18:15:36 +02:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
starlette
|
|
|
|
pydantic
|
|
|
|
];
|
|
|
|
|
2019-12-29 19:08:35 +01:00
|
|
|
checkInputs = [
|
|
|
|
aiosqlite
|
2021-01-04 10:36:49 +01:00
|
|
|
databases
|
2020-04-07 20:02:51 +02:00
|
|
|
flask
|
2021-01-04 10:36:49 +01:00
|
|
|
httpx
|
|
|
|
passlib
|
|
|
|
peewee
|
|
|
|
python-jose
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-asyncio
|
|
|
|
sqlalchemy
|
2021-10-08 18:10:25 +02:00
|
|
|
trio
|
2022-05-22 16:26:11 +02:00
|
|
|
] ++ passlib.optional-dependencies.bcrypt;
|
2019-12-29 19:08:35 +01:00
|
|
|
|
2021-08-27 12:44:49 +02:00
|
|
|
pytestFlagsArray = [
|
2022-01-01 17:16:44 +01:00
|
|
|
# ignoring deprecation warnings to avoid test failure from
|
|
|
|
# tests/test_tutorial/test_testing/test_tutorial001.py
|
2021-08-27 12:44:49 +02:00
|
|
|
"-W ignore::DeprecationWarning"
|
|
|
|
];
|
|
|
|
|
2022-01-01 17:16:44 +01:00
|
|
|
disabledTestPaths = [
|
|
|
|
# Disabled tests require orjson which requires rust nightly
|
|
|
|
"tests/test_default_response_class.py"
|
2022-01-08 10:49:06 +01:00
|
|
|
# Don't test docs and examples
|
|
|
|
"docs_src"
|
2022-01-01 17:16:44 +01:00
|
|
|
];
|
|
|
|
|
2021-08-27 12:44:49 +02:00
|
|
|
disabledTests = [
|
|
|
|
"test_get_custom_response"
|
|
|
|
# Failed: DID NOT RAISE <class 'starlette.websockets.WebSocketDisconnect'>
|
|
|
|
"test_websocket_invalid_data"
|
|
|
|
"test_websocket_no_credentials"
|
2022-04-19 12:33:28 +02:00
|
|
|
# TypeError: __init__() missing 1...starlette-releated
|
|
|
|
"test_head"
|
|
|
|
"test_options"
|
|
|
|
"test_trace"
|
2021-08-27 12:44:49 +02:00
|
|
|
];
|
2019-07-26 18:15:36 +02:00
|
|
|
|
2022-01-01 17:16:44 +01:00
|
|
|
pythonImportsCheck = [
|
|
|
|
"fastapi"
|
|
|
|
];
|
|
|
|
|
2019-07-26 18:15:36 +02:00
|
|
|
meta = with lib; {
|
2022-01-01 17:16:44 +01:00
|
|
|
description = "Web framework for building APIs";
|
2019-07-26 18:15:36 +02:00
|
|
|
homepage = "https://github.com/tiangolo/fastapi";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ wd15 ];
|
|
|
|
};
|
|
|
|
}
|