Merge pull request #307098 from r-ryantm/auto-update/cilium-cli
[NixPkgs.git] / pkgs / development / python-modules / flask-seasurf / default.nix
blob1764e2762059acb0bce7053eeed81c347bd8d8c5
1 { lib, fetchFromGitHub, fetchpatch, buildPythonPackage, isPy3k, flask, mock, unittestCheckHook }:
3 buildPythonPackage rec {
4   pname = "flask-seasurf";
5   version = "1.1.1";
6   disabled = !isPy3k;
8   src = fetchFromGitHub {
9     owner = "maxcountryman";
10     repo = "flask-seasurf";
11     rev = version;
12     hash = "sha256-L/ZUEqqHmsyXG5eShcITII36ttwQlZN5GBngo+GcCdw=";
13   };
15   patches = [
16     # Remove usage of deprecated flask._app_ctx_stack
17     (fetchpatch {
18       url = "https://github.com/maxcountryman/flask-seasurf/commit/9039764a4e44aeb1acb6ae7747deb438bee0826b.patch";
19       hash = "sha256-bVYzJN6MXzH3fNMknd2bh+04JlPJRkU0cLcWv+Rigqc=";
20     })
21     ./0001-Fix-with-new-dependency-versions.patch
22   ];
24   postPatch = ''
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
27   '';
29   propagatedBuildInputs = [ flask ];
31   nativeCheckInputs = [
32     unittestCheckHook
33     mock
34   ];
36   pythonImportsCheck = [ "flask_seasurf" ];
38   meta = with lib; {
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 ];
43   };