about summary refs log tree commit diff
path: root/pkgs/development/python-modules/django-js-reverse/default.nix
blob: a63ef50a8068c9d49fec45a88786f6b6d9a8170a (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
52
53
54
{ lib
, buildPythonPackage
, fetchpatch
, fetchFromGitHub
, python
, django
, nodejs
, js2py
, six
}:

buildPythonPackage rec {
  pname = "django-js-reverse";
  # Support for Django 4.0 not yet released
  version = "unstable-2022-09-16";

  src = fetchFromGitHub {
    owner = "ierror";
    repo = "django-js-reverse";
    rev = "7cab78c4531780ab4b32033d5104ccd5be1a246a";
    sha256 = "sha256-oA4R5MciDMcSsb+GAgWB5jhj+nl7E8t69u0qlx2G93E=";
  };

  patches = [
    (fetchpatch {
      name = "fix-requires_system_checks-list-or-tuple";
      url = "https://github.com/ierror/django-js-reverse/commit/1477ba44b62c419d12ebec86e56973f1ae56f712.patch";
      sha256 = "sha256-xUtCziewVhnCOaNWddJBH4/Vvhwjjq/wcQDvh2YzWMQ=";
    })
  ];

  propagatedBuildInputs = [
    django
  ];

  nativeCheckInputs = [
    nodejs
    js2py
    six
  ];

  checkPhase = ''
    ${python.interpreter} django_js_reverse/tests/unit_tests.py
  '';

  pythonImportsCheck = [ "django_js_reverse" ];

  meta = with lib; {
    description = "Javascript url handling for Django that doesn't hurt";
    homepage = "https://django-js-reverse.readthedocs.io/en/latest/";
    license = licenses.mit;
    maintainers = with maintainers; [ ambroisie ];
  };
}