1{ lib
2, buildPythonPackage
3, fetchFromGitHub
4, pydantic
5, starlette
6, pytestCheckHook
7, pytest-asyncio
8, aiosqlite
9, databases
10, flask
11, httpx
12, passlib
13, peewee
14, python-jose
15, sqlalchemy
16, trio
17}:
18
19buildPythonPackage rec {
20 pname = "fastapi";
21 version = "0.70.0";
22 format = "flit";
23
24 src = fetchFromGitHub {
25 owner = "tiangolo";
26 repo = "fastapi";
27 rev = version;
28 sha256 = "sha256-mLI+w9PeewnwUMuUnXj6J2r/3shinjlwXMnhNcQlhrM=";
29 };
30
31 postPatch = ''
32 substituteInPlace pyproject.toml \
33 --replace "starlette ==" "starlette >="
34 '';
35
36 propagatedBuildInputs = [
37 starlette
38 pydantic
39 ];
40
41 checkInputs = [
42 aiosqlite
43 databases
44 flask
45 httpx
46 passlib
47 peewee
48 python-jose
49 pytestCheckHook
50 pytest-asyncio
51 sqlalchemy
52 trio
53 ];
54
55 # disabled tests require orjson which requires rust nightly
56
57 # ignoring deprecation warnings to avoid test failure from
58 # tests/test_tutorial/test_testing/test_tutorial001.py
59
60 pytestFlagsArray = [
61 "--ignore=tests/test_default_response_class.py"
62 "-W ignore::DeprecationWarning"
63 ];
64
65 disabledTests = [
66 "test_get_custom_response"
67
68 # Failed: DID NOT RAISE <class 'starlette.websockets.WebSocketDisconnect'>
69 "test_websocket_invalid_data"
70 "test_websocket_no_credentials"
71 ];
72
73 meta = with lib; {
74 homepage = "https://github.com/tiangolo/fastapi";
75 description = "FastAPI framework, high performance, easy to learn, fast to code, ready for production";
76 license = licenses.mit;
77 maintainers = with maintainers; [ wd15 ];
78 };
79}