1{
2 lib,
3 buildPythonPackage,
4 fetchFromGitHub,
5 fetchpatch,
6 flit-core,
7 django,
8 djangorestframework,
9 drf-spectacular,
10 inflection,
11 pytestCheckHook,
12 pytest-django,
13 django-filter,
14}:
15
16buildPythonPackage rec {
17 pname = "drf-standardized-errors";
18 version = "0.14.1";
19 pyproject = true;
20
21 src = fetchFromGitHub {
22 owner = "ghazi-git";
23 repo = "drf-standardized-errors";
24 tag = "v${version}";
25 hash = "sha256-Gr4nj2dd0kZTc4IbLhb0i3CnY+VZaNnr3YJctyxIgQU=";
26 };
27
28 patches = [
29 # fix test_openapi_utils test
30 (fetchpatch {
31 url = "https://github.com/ghazi-git/drf-standardized-errors/commit/dbc37d4228bdefa858ab299517097d6e52a0b698.patch";
32 hash = "sha256-CZTBmhAFKODGLiN2aQNKMaR8VyKs0H55Tzu4Rh6X9R8=";
33 })
34 ];
35
36 build-system = [ flit-core ];
37
38 dependencies = [
39 django
40 djangorestframework
41 ];
42
43 nativeCheckInputs = [
44 pytestCheckHook
45 pytest-django
46 django-filter
47 drf-spectacular
48 ];
49
50 env.DJANGO_SETTINGS_MODULE = "tests.settings";
51
52 pythonImportsCheck = [ "drf_standardized_errors" ];
53
54 optional-dependencies.openapi = [
55 drf-spectacular
56 inflection
57 ];
58
59 meta = with lib; {
60 description = "Standardize your DRF API error responses";
61 homepage = "https://github.com/ghazi-git/drf-standardized-errors";
62 changelog = "https://github.com/ghazi-git/drf-standardized-errors/releases/tag/${src.tag}";
63 license = licenses.mit;
64 maintainers = with maintainers; [ erictapen ];
65 };
66}