2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
pythonOlder,
|
|
|
|
|
|
|
|
# build-system
|
2024-07-27 06:49:29 +00:00
|
|
|
pdm-backend,
|
2024-06-05 15:53:02 +00:00
|
|
|
|
|
|
|
# dependencies
|
2024-07-27 06:49:29 +00:00
|
|
|
fastapi-cli,
|
2024-06-05 15:53:02 +00:00
|
|
|
starlette,
|
|
|
|
pydantic,
|
|
|
|
typing-extensions,
|
|
|
|
|
|
|
|
# tests
|
|
|
|
dirty-equals,
|
|
|
|
flask,
|
|
|
|
passlib,
|
2024-09-19 14:19:46 +00:00
|
|
|
pyjwt,
|
2024-06-05 15:53:02 +00:00
|
|
|
pytest-asyncio,
|
|
|
|
pytestCheckHook,
|
|
|
|
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-09-19 14:19:46 +00:00
|
|
|
version = "0.112.0";
|
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-09-19 14:19:46 +00:00
|
|
|
hash = "sha256-M09yte0BGC5w3AZSwDUr9qKUrotqVklO8mwyms9B95Y=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
build-system = [ pdm-backend ];
|
2024-01-13 08:15:51 +00:00
|
|
|
|
|
|
|
pythonRelaxDeps = [
|
|
|
|
"anyio"
|
|
|
|
"starlette"
|
2022-09-30 11:47:45 +00:00
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
dependencies = [
|
|
|
|
fastapi-cli
|
2020-04-24 23:36:52 +00:00
|
|
|
starlette
|
|
|
|
pydantic
|
2023-11-16 04:20:00 +00:00
|
|
|
typing-extensions
|
2020-04-24 23:36:52 +00:00
|
|
|
];
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
optional-dependencies.all =
|
2024-06-05 15:53:02 +00:00
|
|
|
[
|
|
|
|
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
|
2024-09-19 14:19:46 +00:00
|
|
|
pyjwt
|
2021-01-09 10:05:03 +00:00
|
|
|
pytestCheckHook
|
|
|
|
pytest-asyncio
|
2021-10-09 14:59:57 +00:00
|
|
|
trio
|
2023-11-16 04:20:00 +00:00
|
|
|
sqlalchemy
|
2024-09-19 14:19:46 +00:00
|
|
|
] ++ optional-dependencies.all;
|
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"
|
2024-09-19 14:19:46 +00:00
|
|
|
"-W ignore::pytest.PytestUnraisableExceptionWarning"
|
|
|
|
];
|
|
|
|
|
|
|
|
disabledTests = [
|
|
|
|
# Coverage test
|
|
|
|
"test_fastapi_cli"
|
|
|
|
# ResourceWarning: Unclosed <MemoryObjectSendStream>
|
|
|
|
"test_openapi_schema"
|
2021-09-18 10:52:07 +00:00
|
|
|
];
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|