summaryrefslogtreecommitdiff
path: root/pkgs/development/python-modules/drf-standardized-errors/default.nix
blob: e1b116229d1542b57dad93aa473505970a7eb15d (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
57
58
{
  lib,
  buildPythonPackage,
  fetchFromGitHub,
  fetchpatch,
  flit-core,
  django,
  djangorestframework,
  drf-spectacular,
  inflection,
  pytestCheckHook,
  pytest-django,
  django-filter,
}:

buildPythonPackage rec {
  pname = "drf-standardized-errors";
  version = "0.15.0";
  pyproject = true;

  src = fetchFromGitHub {
    owner = "ghazi-git";
    repo = "drf-standardized-errors";
    tag = "v${version}";
    hash = "sha256-OM1bTqM3yQSPuerTrq5FKTf5eKpZsF6/QgupMtnnT4Q=";
  };

  build-system = [ flit-core ];

  dependencies = [
    django
    djangorestframework
  ];

  nativeCheckInputs = [
    pytestCheckHook
    pytest-django
    django-filter
    drf-spectacular
  ];

  env.DJANGO_SETTINGS_MODULE = "tests.settings";

  pythonImportsCheck = [ "drf_standardized_errors" ];

  optional-dependencies.openapi = [
    drf-spectacular
    inflection
  ];

  meta = {
    description = "Standardize your DRF API error responses";
    homepage = "https://github.com/ghazi-git/drf-standardized-errors";
    changelog = "https://github.com/ghazi-git/drf-standardized-errors/releases/tag/${src.tag}";
    license = lib.licenses.mit;
    maintainers = with lib.maintainers; [ erictapen ];
  };
}