2020-04-24 23:36:52 +00:00
|
|
|
{ lib
|
|
|
|
, buildPythonPackage
|
|
|
|
, fetchFromGitHub
|
2023-11-16 04:20:00 +00:00
|
|
|
, pythonOlder
|
2024-01-13 08:15:51 +00:00
|
|
|
, pythonRelaxDepsHook
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
# build-system
|
|
|
|
, hatchling
|
|
|
|
|
|
|
|
# dependencies
|
2021-01-09 10:05:03 +00:00
|
|
|
, starlette
|
2023-11-16 04:20:00 +00:00
|
|
|
, pydantic
|
|
|
|
, typing-extensions
|
|
|
|
|
|
|
|
# tests
|
|
|
|
, dirty-equals
|
2020-04-24 23:36:52 +00:00
|
|
|
, flask
|
2021-01-09 10:05:03 +00:00
|
|
|
, passlib
|
2023-11-16 04:20:00 +00:00
|
|
|
, pytest-asyncio
|
|
|
|
, pytestCheckHook
|
2021-01-09 10:05:03 +00:00
|
|
|
, python-jose
|
|
|
|
, sqlalchemy
|
2021-10-09 14:59:57 +00:00
|
|
|
, trio
|
2023-11-16 04:20:00 +00:00
|
|
|
|
|
|
|
# optional-dependencies
|
|
|
|
, httpx
|
|
|
|
, jinja2
|
|
|
|
, python-multipart
|
|
|
|
, itsdangerous
|
|
|
|
, pyyaml
|
|
|
|
, ujson
|
|
|
|
, orjson
|
|
|
|
, email-validator
|
|
|
|
, uvicorn
|
2024-01-13 08:15:51 +00:00
|
|
|
, pydantic-settings
|
|
|
|
, pydantic-extra-types
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "fastapi";
|
2024-02-29 20:09:43 +00:00
|
|
|
version = "0.109.0";
|
|
|
|
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";
|
2022-01-03 16:56:52 +00:00
|
|
|
repo = pname;
|
2022-07-18 16:21:45 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-02-29 20:09:43 +00:00
|
|
|
hash = "sha256-iZBc0tYGmhQuOL/pdthhBYYnZhe+wEttoinePNAIgEs=";
|
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
|
|
|
];
|
|
|
|
|
2023-11-16 04:20:00 +00:00
|
|
|
passthru.optional-dependencies.all = [
|
2021-01-09 10:05:03 +00:00
|
|
|
httpx
|
2023-11-16 04:20:00 +00:00
|
|
|
jinja2
|
|
|
|
python-multipart
|
|
|
|
itsdangerous
|
|
|
|
pyyaml
|
|
|
|
ujson
|
2022-09-30 11:47:45 +00:00
|
|
|
orjson
|
2023-11-16 04:20:00 +00:00
|
|
|
email-validator
|
|
|
|
uvicorn
|
2024-01-13 08:15:51 +00:00
|
|
|
] ++ lib.optionals (lib.versionAtLeast pydantic.version "2") [
|
|
|
|
pydantic-settings
|
|
|
|
pydantic-extra-types
|
2023-11-16 04:20:00 +00:00
|
|
|
] ++ uvicorn.optional-dependencies.standard;
|
|
|
|
|
|
|
|
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
|
|
|
|
] ++ 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
|
|
|
];
|
|
|
|
|
|
|
|
pythonImportsCheck = [
|
|
|
|
"fastapi"
|
|
|
|
];
|
|
|
|
|
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 ];
|
|
|
|
};
|
|
|
|
}
|