nixpkgs-suyu/pkgs/development/python-modules/fastapi/default.nix

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

93 lines
1.8 KiB
Nix
Raw Normal View History

2019-07-26 18:15:36 +02:00
{ lib
, buildPythonPackage
, fetchFromGitHub
2019-07-26 18:15:36 +02:00
, pydantic
, starlette
, pytestCheckHook
, pytest-asyncio
, aiosqlite
, databases
, flask
, httpx
, passlib
, peewee
, python-jose
, sqlalchemy
, trio
, pythonOlder
2019-07-26 18:15:36 +02:00
}:
buildPythonPackage rec {
pname = "fastapi";
version = "0.78.0";
format = "flit";
2019-07-26 18:15:36 +02:00
disabled = pythonOlder "3.6";
src = fetchFromGitHub {
owner = "tiangolo";
repo = pname;
rev = version;
hash = "sha256-4JS0VLVg67O7VdcDw2k2u+98kiCdCHvCAEGHYGWEIOA=";
2019-07-26 18:15:36 +02:00
};
postPatch = ''
substituteInPlace pyproject.toml \
--replace "starlette==" "starlette>="
'';
2019-07-26 18:15:36 +02:00
propagatedBuildInputs = [
starlette
pydantic
];
checkInputs = [
aiosqlite
databases
flask
httpx
passlib
peewee
python-jose
pytestCheckHook
pytest-asyncio
sqlalchemy
trio
] ++ passlib.optional-dependencies.bcrypt;
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"
# Don't test docs and examples
"docs_src"
];
disabledTests = [
"test_get_custom_response"
# Failed: DID NOT RAISE <class 'starlette.websockets.WebSocketDisconnect'>
"test_websocket_invalid_data"
"test_websocket_no_credentials"
# TypeError: __init__() missing 1...starlette-releated
"test_head"
"test_options"
"test_trace"
];
2019-07-26 18:15:36 +02:00
pythonImportsCheck = [
"fastapi"
];
2019-07-26 18:15:36 +02:00
meta = with lib; {
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 ];
};
}