depot/third_party/nixpkgs/pkgs/development/python-modules/fastapi/default.nix
Default email 66604c92c1 Project import generated by Copybara.
GitOrigin-RevId: 32b8ed738096bafb4cdb7f70347a0f63f9f40151
2020-05-15 23:57:56 +02:00

66 lines
1.5 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, uvicorn
, starlette
, pydantic
, isPy3k
, pytest
, pytestcov
, pyjwt
, passlib
, aiosqlite
, peewee
, flask
}:
buildPythonPackage rec {
pname = "fastapi";
version = "0.54.1";
format = "flit";
disabled = !isPy3k;
src = fetchFromGitHub {
owner = "tiangolo";
repo = "fastapi";
rev = version;
sha256 = "0k0lss8x6lzf0szcli48v28r269fsx1jdkr9q78liz47dz5x03d8";
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace "starlette ==0.13.2" "starlette"
'';
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 ];
};
}