1{
2 lib,
3 buildPythonPackage,
4 isPy27,
5 fetchFromGitHub,
6 itsdangerous,
7 python-multipart,
8 pytestCheckHook,
9 starlette,
10 httpx,
11 pytest-asyncio,
12}:
13
14buildPythonPackage rec {
15 version = "0.9";
16 format = "setuptools";
17 pname = "asgi-csrf";
18 disabled = isPy27;
19
20 # PyPI tarball doesn't include tests directory
21 src = fetchFromGitHub {
22 owner = "simonw";
23 repo = pname;
24 rev = version;
25 hash = "sha256-mmOsN2mW6eGtapq3xLqHK8hhSD0Gjzp3DsY5AGUlI8g=";
26 };
27
28 propagatedBuildInputs = [
29 itsdangerous
30 python-multipart
31 ];
32
33 nativeCheckInputs = [
34 httpx
35 pytest-asyncio
36 pytestCheckHook
37 starlette
38 ];
39
40 doCheck = false; # asgi-lifespan missing
41
42 pythonImportsCheck = [ "asgi_csrf" ];
43
44 meta = with lib; {
45 description = "ASGI middleware for protecting against CSRF attacks";
46 license = licenses.asl20;
47 homepage = "https://github.com/simonw/asgi-csrf";
48 maintainers = [ maintainers.ris ];
49 };
50}