depot/third_party/nixpkgs/pkgs/development/python-modules/starlette/default.nix
Default email 159e378cbb Project import generated by Copybara.
GitOrigin-RevId: c04d5652cfa9742b1d519688f65d1bbccea9eb7e
2024-09-19 17:19:46 +03:00

84 lines
1.6 KiB
Nix

{
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,
}:
buildPythonPackage rec {
pname = "starlette";
version = "0.37.2";
pyproject = true;
disabled = pythonOlder "3.8";
src = fetchFromGitHub {
owner = "encode";
repo = "starlette";
rev = "refs/tags/${version}";
hash = "sha256-GiCN1sfhLu9i19d2OcLZrlY8E64DFrFh+ITRSvLaxdE=";
};
build-system = [ hatchling ];
dependencies = [ anyio ] ++ lib.optionals (pythonOlder "3.10") [ typing-extensions ];
optional-dependencies.full = [
itsdangerous
jinja2
python-multipart
pyyaml
httpx
];
nativeCheckInputs = [
pytestCheckHook
trio
typing-extensions
] ++ lib.flatten (lib.attrValues optional-dependencies);
pytestFlagsArray = [
"-W"
"ignore::DeprecationWarning"
"-W"
"ignore::trio.TrioDeprecationWarning"
"-W"
"ignore::ResourceWarning" # FIXME remove once test suite is fully compatible with anyio 4.4.0
];
pythonImportsCheck = [ "starlette" ];
passthru.tests = {
inherit fastapi;
};
meta = with lib; {
changelog = "https://www.starlette.io/release-notes/#${lib.replaceStrings [ "." ] [ "" ] version}";
downloadPage = "https://github.com/encode/starlette";
homepage = "https://www.starlette.io/";
description = "Little ASGI framework that shines";
license = licenses.bsd3;
maintainers = with maintainers; [ wd15 ];
};
}