summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/djangorestframework-jsonp/default.nix
blob: 3cca2e0dc79aa95307f1111a1370b46c7dd1fb27 (plain)
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
55
56
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  django,
  python,
  pytest-django,
  pytestCheckHook,
  djangorestframework,
  setuptools,
}:

buildPythonPackage rec {
  pname = "djangorestframework-jsonp";
  version = "1.0.2";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "jpadilla";
    repo = "django-rest-framework-jsonp";
    tag = version;
    hash = "sha256-4mIO69GhtvbQBtztHVQYIDDDSZpKg0g7BFNHEupiYTs=";
  };

  build-system = [ setuptools ];

  dependencies = [
    django
    djangorestframework
  ];

  checkInputs = [
    pytestCheckHook
    pytest-django
  ];

  # Test fail with Django >=4
  # https://github.com/jpadilla/django-rest-framework-jsonp/issues/14
  doCheck = false;

  checkPhase = ''
    runHook preCheck
    rm tests/test_renderers.py
    ${python.interpreter} runtests.py
    runHook postCheck
  '';

  pythonImportsCheck = [ "rest_framework_jsonp" ];

  meta = {
    description = "JSONP support for Django REST Framework";
    homepage = "https://jpadilla.github.io/django-rest-framework-jsonp/";
    license = lib.licenses.bsd3;
    maintainers = [ lib.maintainers.onny ];
  };
}