1{
2 lib,
3 buildPythonPackage,
4 pythonAtLeast,
5 fetchFromGitHub,
6 python,
7 django,
8 packaging,
9 nodejs,
10 six,
11}:
12
13buildPythonPackage rec {
14 pname = "django-js-reverse";
15 version = "0.10.1-b1";
16 format = "setuptools";
17
18 src = fetchFromGitHub {
19 owner = "BITSOLVER";
20 repo = "django-js-reverse";
21 rev = version;
22 hash = "sha256-i78UsxVwxyDAc8LrOVEXLG0tdidoQhvUx7GvPDaH0KY=";
23 };
24
25 propagatedBuildInputs = [ django ] ++ lib.optionals (pythonAtLeast "3.7") [ packaging ];
26
27 # Js2py is needed for tests but it's unmaintained and insecure
28 doCheck = false;
29
30 nativeCheckInputs = [
31 nodejs
32 six
33 ];
34
35 checkPhase = ''
36 ${python.interpreter} django_js_reverse/tests/unit_tests.py
37 '';
38
39 pythonImportsCheck = [ "django_js_reverse" ];
40
41 meta = with lib; {
42 description = "Javascript url handling for Django that doesn't hurt";
43 homepage = "https://django-js-reverse.readthedocs.io/en/latest/";
44 license = licenses.mit;
45 maintainers = with maintainers; [ ambroisie ];
46 };
47}