2020-08-27 23:26:05 +01:00
|
|
|
{ stdenv, buildPythonPackage, isPy27, fetchFromGitHub, itsdangerous, python-multipart
|
2020-10-29 17:13:47 +00:00
|
|
|
, pytestCheckHook, starlette, httpx, pytest-asyncio }:
|
2020-08-27 23:26:05 +01:00
|
|
|
|
|
|
|
buildPythonPackage rec {
|
2020-10-29 17:16:10 +00:00
|
|
|
version = "0.7.1";
|
2020-08-27 23:26:05 +01:00
|
|
|
pname = "asgi-csrf";
|
|
|
|
disabled = isPy27;
|
|
|
|
|
|
|
|
# PyPI tarball doesn't include tests directory
|
|
|
|
src = fetchFromGitHub {
|
|
|
|
owner = "simonw";
|
|
|
|
repo = pname;
|
|
|
|
rev = version;
|
2020-10-29 17:16:10 +00:00
|
|
|
sha256 = "1hhqrb9r46y6i3d3w6hc9zm6yyikdyd2k5pcbyw0r9fl959yi4hf";
|
2020-08-27 23:26:05 +01:00
|
|
|
};
|
|
|
|
|
2020-10-29 17:13:47 +00:00
|
|
|
propagatedBuildInputs = [
|
|
|
|
itsdangerous
|
|
|
|
python-multipart
|
|
|
|
];
|
|
|
|
|
|
|
|
checkInputs = [
|
|
|
|
httpx
|
|
|
|
pytest-asyncio
|
|
|
|
pytestCheckHook
|
|
|
|
starlette
|
|
|
|
];
|
|
|
|
|
|
|
|
# tests fail while importing a private module from httpx
|
|
|
|
# E ModuleNotFoundError: No module named 'httpx._content_streams'
|
|
|
|
# https://github.com/simonw/asgi-csrf/issues/18
|
|
|
|
doCheck = false;
|
2020-08-27 23:26:05 +01:00
|
|
|
|
|
|
|
pythonImportsCheck = [ "asgi_csrf" ];
|
|
|
|
|
|
|
|
meta = with stdenv.lib; {
|
|
|
|
description = "ASGI middleware for protecting against CSRF attacks";
|
|
|
|
license = licenses.asl20;
|
|
|
|
homepage = "https://github.com/simonw/asgi-csrf";
|
|
|
|
maintainers = [ maintainers.ris ];
|
|
|
|
};
|
|
|
|
}
|