depot/third_party/nixpkgs/pkgs/development/python-modules/fastapi/default.nix
Default email 2495e3f88b Project import generated by Copybara.
GitOrigin-RevId: 78cd22c1b8604de423546cd49bfe264b786eca13
2022-01-03 17:56:52 +01:00

87 lines
1.6 KiB
Nix

{ lib
, buildPythonPackage
, fetchFromGitHub
, pydantic
, starlette
, pytestCheckHook
, pytest-asyncio
, aiosqlite
, databases
, flask
, httpx
, passlib
, peewee
, python-jose
, sqlalchemy
, trio
, pythonOlder
}:
buildPythonPackage rec {
pname = "fastapi";
version = "0.70.1";
format = "flit";
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "tiangolo";
repo = pname;
rev = version;
sha256 = "sha256-iwjxcAe8h38PPTTDGCxIJSB7zCS0FA0gOcKUjPpk3yg=";
};
propagatedBuildInputs = [
starlette
pydantic
];
checkInputs = [
aiosqlite
databases
flask
httpx
passlib
peewee
python-jose
pytestCheckHook
pytest-asyncio
sqlalchemy
trio
];
postPatch = ''
substituteInPlace pyproject.toml \
--replace "starlette ==" "starlette >="
'';
pytestFlagsArray = [
# ignoring deprecation warnings to avoid test failure from
# tests/test_tutorial/test_testing/test_tutorial001.py
"-W ignore::DeprecationWarning"
];
disabledTestPaths = [
# Disabled tests require orjson which requires rust nightly
"tests/test_default_response_class.py"
];
disabledTests = [
"test_get_custom_response"
# Failed: DID NOT RAISE <class 'starlette.websockets.WebSocketDisconnect'>
"test_websocket_invalid_data"
"test_websocket_no_credentials"
];
pythonImportsCheck = [
"fastapi"
];
meta = with lib; {
description = "Web framework for building APIs";
homepage = "https://github.com/tiangolo/fastapi";
license = licenses.mit;
maintainers = with maintainers; [ wd15 ];
};
}