2024-06-05 15:53:02 +00:00
|
|
|
{
|
|
|
|
lib,
|
|
|
|
buildPythonPackage,
|
|
|
|
fetchFromGitHub,
|
|
|
|
|
|
|
|
# build-system
|
|
|
|
hatchling,
|
|
|
|
|
|
|
|
# dependencies
|
|
|
|
anyio,
|
|
|
|
typing-extensions,
|
|
|
|
|
|
|
|
# optional dependencies
|
|
|
|
itsdangerous,
|
|
|
|
jinja2,
|
|
|
|
python-multipart,
|
|
|
|
pyyaml,
|
|
|
|
httpx,
|
|
|
|
|
|
|
|
# tests
|
|
|
|
pytestCheckHook,
|
|
|
|
pythonOlder,
|
|
|
|
trio,
|
|
|
|
|
|
|
|
# reverse dependencies
|
|
|
|
fastapi,
|
2020-04-24 23:36:52 +00:00
|
|
|
}:
|
|
|
|
|
|
|
|
buildPythonPackage rec {
|
|
|
|
pname = "starlette";
|
2024-04-21 15:54:59 +00:00
|
|
|
version = "0.37.2";
|
2024-02-29 20:09:43 +00:00
|
|
|
pyproject = true;
|
2022-01-03 16:56:52 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
disabled = pythonOlder "3.8";
|
2020-04-24 23:36:52 +00:00
|
|
|
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "encode";
|
2024-04-21 15:54:59 +00:00
|
|
|
repo = "starlette";
|
2022-08-12 12:06:08 +00:00
|
|
|
rev = "refs/tags/${version}";
|
2024-04-21 15:54:59 +00:00
|
|
|
hash = "sha256-GiCN1sfhLu9i19d2OcLZrlY8E64DFrFh+ITRSvLaxdE=";
|
2020-04-24 23:36:52 +00:00
|
|
|
};
|
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
build-system = [ hatchling ];
|
2022-11-02 22:02:43 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
dependencies = [ anyio ] ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ];
|
2024-02-29 20:09:43 +00:00
|
|
|
|
2024-07-27 06:49:29 +00:00
|
|
|
optional-dependencies.full = [
|
2020-04-24 23:36:52 +00:00
|
|
|
itsdangerous
|
|
|
|
jinja2
|
2021-01-09 10:05:03 +00:00
|
|
|
python-multipart
|
2020-04-24 23:36:52 +00:00
|
|
|
pyyaml
|
2023-02-02 18:25:31 +00:00
|
|
|
httpx
|
2021-09-18 10:52:07 +00:00
|
|
|
];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-02-02 18:25:31 +00:00
|
|
|
nativeCheckInputs = [
|
2021-01-09 10:05:03 +00:00
|
|
|
pytestCheckHook
|
2021-09-18 10:52:07 +00:00
|
|
|
trio
|
2021-01-09 10:05:03 +00:00
|
|
|
typing-extensions
|
2024-07-27 06:49:29 +00:00
|
|
|
] ++ lib.flatten (lib.attrValues optional-dependencies);
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2023-01-20 10:41:00 +00:00
|
|
|
pytestFlagsArray = [
|
2024-06-05 15:53:02 +00:00
|
|
|
"-W"
|
|
|
|
"ignore::DeprecationWarning"
|
|
|
|
"-W"
|
|
|
|
"ignore::trio.TrioDeprecationWarning"
|
2023-01-20 10:41:00 +00:00
|
|
|
];
|
|
|
|
|
2024-06-05 15:53:02 +00:00
|
|
|
pythonImportsCheck = [ "starlette" ];
|
2020-04-24 23:36:52 +00:00
|
|
|
|
2024-02-29 20:09:43 +00:00
|
|
|
passthru.tests = {
|
|
|
|
inherit fastapi;
|
|
|
|
};
|
|
|
|
|
2020-04-24 23:36:52 +00:00
|
|
|
meta = with lib; {
|
2024-04-21 15:54:59 +00:00
|
|
|
changelog = "https://www.starlette.io/release-notes/#${lib.replaceStrings [ "." ] [ "" ] version}";
|
2023-11-16 04:20:00 +00:00
|
|
|
downloadPage = "https://github.com/encode/starlette";
|
2020-04-24 23:36:52 +00:00
|
|
|
homepage = "https://www.starlette.io/";
|
2024-06-20 14:57:18 +00:00
|
|
|
description = "Little ASGI framework that shines";
|
2020-04-24 23:36:52 +00:00
|
|
|
license = licenses.bsd3;
|
|
|
|
maintainers = with maintainers; [ wd15 ];
|
|
|
|
};
|
|
|
|
}
|