2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
pythonRelaxDepsHook,
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
hatchling,
|
|
|
|
|
|
|
|
# dependencies
|
|
|
|
starlette,
|
|
|
|
pydantic,
|
|
|
|
typing-extensions,
|
|
|
|
|
|
|
|
# tests
|
|
|
|
dirty-equals,
|
|
|
|
flask,
|
|
|
|
passlib,
|
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
|
|
|
python-jose,
|
|
|
|
sqlalchemy,
|
|
|
|
trio,
|
|
|
|
|
|
|
|
# optional-dependencies
|
|
|
|
httpx,
|
|
|
|
jinja2,
|
|
|
|
python-multipart,
|
|
|
|
itsdangerous,
|
|
|
|
pyyaml,
|
|
|
|
ujson,
|
|
|
|
orjson,
|
|
|
|
email-validator,
|
|
|
|
uvicorn,
|
|
|
|
pydantic-settings,
|
|
|
|
pydantic-extra-types,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "fastapi";
|
2024-05-15 15:35:15 +00:00
|
|
|
version = "0.110.2";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
disabled = pythonOlder "3.7";
|
2022-01-03 16:56:52 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "tiangolo";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "fastapi";
|
2022-07-18 16:21:45 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-05-15 15:35:15 +00:00
|
|
|
hash = "sha256-qUh5exkXVRcKIO0t4KIOZhhpsftj3BrWaL2asf8RqUI=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2022-09-30 11:47:45 +00:00
|
|
|
nativeBuildInputs = [
|
|
|
|
hatchling
|
2024-01-13 08:15:51 +00:00
|
|
|
pythonRelaxDepsHook
|
|
|
|
];
|
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"anyio"
|
|
|
|
# https://github.com/tiangolo/fastapi/pull/9636
|
|
|
|
"starlette"
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
starlette
|
|
|
|
pydantic
|
2023-11-16 04:20:00 +00:00
|
|
|
typing-extensions
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
passthru.optional-dependencies.all =
|
|
|
|
[
|
|
|
|
httpx
|
|
|
|
jinja2
|
|
|
|
python-multipart
|
|
|
|
itsdangerous
|
|
|
|
pyyaml
|
|
|
|
ujson
|
|
|
|
orjson
|
|
|
|
email-validator
|
|
|
|
uvicorn
|
|
|
|
]
|
|
|
|
++ lib.optionals (lib.versionAtLeast pydantic.version "2") [
|
|
|
|
pydantic-settings
|
|
|
|
pydantic-extra-types
|
|
|
|
]
|
|
|
|
++ uvicorn.optional-dependencies.standard;
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
nativeCheckInputs = [
|
|
|
|
dirty-equals
|
|
|
|
flask
|
2021-01-09 10:05:03 +00:00
|
|
|
passlib
|
|
|
|
pytestCheckHook
|
|
|
|
pytest-asyncio
|
2023-11-16 04:20:00 +00:00
|
|
|
python-jose
|
2021-10-09 14:59:57 +00:00
|
|
|
trio
|
2023-11-16 04:20:00 +00:00
|
|
|
sqlalchemy
|
2024-06-05 15:53:02 +00:00
|
|
|
] ++ passthru.optional-dependencies.all ++ python-jose.optional-dependencies.cryptography;
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2021-09-18 10:52:07 +00:00
|
|
|
pytestFlagsArray = [
|
2022-01-03 16:56:52 +00:00
|
|
|
# ignoring deprecation warnings to avoid test failure from
|
|
|
|
# tests/test_tutorial/test_testing/test_tutorial001.py
|
2021-09-18 10:52:07 +00:00
|
|
|
"-W ignore::DeprecationWarning"
|
|
|
|
];
|
|
|
|
|
2022-01-03 16:56:52 +00:00
|
|
|
disabledTestPaths = [
|
2022-01-13 20:06:32 +00:00
|
|
|
# Don't test docs and examples
|
|
|
|
"docs_src"
|
2023-03-15 16:39:30 +00:00
|
|
|
# databases is incompatible with SQLAlchemy 2.0
|
|
|
|
"tests/test_tutorial/test_async_sql_databases"
|
|
|
|
"tests/test_tutorial/test_sql_databases"
|
2022-01-03 16:56:52 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "fastapi" ];
|
2022-01-03 16:56:52 +00:00
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2024-02-29 20:09:43 +00:00
|
|
|
changelog = "https://github.com/tiangolo/fastapi/releases/tag/${version}";
|
2022-01-03 16:56:52 +00:00
|
|
|
description = "Web framework for building APIs";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://github.com/tiangolo/fastapi";
|
|
|
|
license = licenses.mit;
|
|
|
|
maintainers = with maintainers; [ wd15 ];
|
|
|
|
};
|
|
|
|
}
|