1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 pythonOlder,
6 # build inputs
7 starlette,
8 brotli,
9 # check inputs
10 httpx,
11 requests,
12 mypy,
13 brotlipy,
14}:
15let
16 pname = "brotli-asgi";
17 version = "1.4.0";
18in
19buildPythonPackage {
20 inherit pname version;
21 format = "setuptools";
22
23 disabled = pythonOlder "3.8";
24
25 src = fetchFromGitHub {
26 owner = "fullonic";
27 repo = "brotli-asgi";
28 rev = "v${version}";
29 hash = "sha256-hQ6CSXnAoUSaKUSmE+2GHZemkFqd8Dc5+OvcUD7/r5Y=";
30 };
31
32 propagatedBuildInputs = [
33 starlette
34 brotli
35 ];
36
37 pythonImportsCheck = [ "brotli_asgi" ];
38
39 nativeCheckInputs = [
40 httpx
41 requests
42 mypy
43 brotlipy
44 ];
45
46 meta = with lib; {
47 description = "Compression AGSI middleware using brotli";
48 homepage = "https://github.com/fullonic/brotli-asgi";
49 license = licenses.mit;
50 maintainers = with maintainers; [ happysalada ];
51 };
52}