1 { lib, fetchFromGitHub, fetchpatch, buildPythonPackage, isPy3k, flask, mock, unittestCheckHook }:
3 buildPythonPackage rec {
4 pname = "flask-seasurf";
8 src = fetchFromGitHub {
9 owner = "maxcountryman";
10 repo = "flask-seasurf";
12 hash = "sha256-L/ZUEqqHmsyXG5eShcITII36ttwQlZN5GBngo+GcCdw=";
16 # Remove usage of deprecated flask._app_ctx_stack
18 url = "https://github.com/maxcountryman/flask-seasurf/commit/9039764a4e44aeb1acb6ae7747deb438bee0826b.patch";
19 hash = "sha256-bVYzJN6MXzH3fNMknd2bh+04JlPJRkU0cLcWv+Rigqc=";
21 ./0001-Fix-with-new-dependency-versions.patch
25 # Disable some tests, pytest is not supported
26 sed -i "s#\(\(test_header_set_on_post\|test_https_good_referer\|test_https_referer_check_disabled\)(self):\)#\1\n return#g" test_seasurf.py
29 propagatedBuildInputs = [ flask ];
36 pythonImportsCheck = [ "flask_seasurf" ];
39 description = "A Flask extension for preventing cross-site request forgery";
40 homepage = "https://github.com/maxcountryman/flask-seasurf";
41 license = licenses.bsd3;
42 maintainers = with maintainers; [ zhaofengli ];