summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/djangorestframework-dataclasses/default.nix
blob: f3c6d0ed377668e8a0b044b664d88bee5e5a7e3d (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
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  djangorestframework,
  pytest-django,
  pytestCheckHook,
  setuptools,
}:

buildPythonPackage rec {
  pname = "djangorestframework-dataclasses";
  version = "1.4.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "oxan";
    repo = "djangorestframework-dataclasses";
    tag = "v${version}";
    hash = "sha256-nUkR5xTyeBv7ziJ6Mej9TKvMOa5/k+ELBqt4BVam/wk=";
  };

  postPatch = ''
    patchShebangs manage.py
  '';

  build-system = [ setuptools ];

  dependencies = [ djangorestframework ];

  nativeCheckInputs = [
    pytest-django
    pytestCheckHook
  ];

  env.DJANGO_SETTINGS_MODULE = "tests.django_settings";

  pythonImportsCheck = [ "rest_framework_dataclasses" ];

  meta = {
    changelog = "https://github.com/oxan/djangorestframework-dataclasses/blob/${src.tag}/CHANGELOG.rst";
    description = "Dataclasses serializer for Django REST framework";
    homepage = "https://github.com/oxan/djangorestframework-dataclasses";
    license = lib.licenses.bsd3;
    maintainers = [ ];
  };
}