about summary refs log tree commit diff
path: root/nixpkgs/pkgs/development/python-modules/django-csp/default.nix
blob: e8f04f188a54ff0bf555318d91ef7e4a60c425a6 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
{ lib
, fetchPypi
, buildPythonPackage

# build-system
, setuptools

# dependencies
, django

# tests
, jinja2
, pytest-django
, pytestCheckHook
}:

buildPythonPackage rec {
  pname = "django-csp";
  version = "3.8";
  pyproject = true;

  src = fetchPypi {
    inherit version;
    pname = "django_csp";
    hash = "sha256-7w8an32Nporm4WnALprGYcDs8E23Dg0dhWQFEqaEccA=";
  };

  postPatch = ''
    sed -i "/addopts =/d" pyproject.toml
  '';

  build-system = [
    setuptools
  ];

  dependencies = [
    django
  ];

  nativeCheckInputs = [
    jinja2
    pytest-django
    pytestCheckHook
  ];

  meta = with lib; {
    description = "Adds Content-Security-Policy headers to Django";
    homepage = "https://github.com/mozilla/django-csp";
    license = licenses.bsd3;
  };
}