summary refs log tree commit diff
path: root/pkgs/development/python-modules/fastapi/default.nix
blob: 0ed9d42c3b0d2a50781f0abfecb323ba242ffcab (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
{ lib
, buildPythonPackage
, fetchFromGitHub
, uvicorn
, starlette
, pydantic
, isPy3k
, pytest
, pytestcov
, pyjwt
, passlib
, aiosqlite
, peewee
, flask
}:

buildPythonPackage rec {
  pname = "fastapi";
  version = "0.54.0";
  format = "flit";
  disabled = !isPy3k;

  src = fetchFromGitHub {
    owner = "tiangolo";
    repo = "fastapi";
    rev = version;
    sha256 = "17bicrpr801z71wrn9iimvh7qk6iwyxvr89ialf0s2rxxa2s0yb5";
  };

  propagatedBuildInputs = [
    uvicorn
    starlette
    pydantic
  ];

  checkInputs = [
    pytest
    pytestcov
    pyjwt
    passlib
    aiosqlite
    peewee
    flask
  ];

  # 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
  checkPhase = ''
    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
  '';

  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 ];
  };
}