1{
2 lib,
3 buildPythonPackage,
4 fetchPypi,
5 setuptools,
6 setuptools-scm,
7 django,
8 djangorestframework,
9 inflection,
10 packaging,
11 pytz,
12 pyyaml,
13 uritemplate,
14 datadiff,
15 dj-database-url,
16 pytest-django,
17 pytestCheckHook,
18}:
19
20buildPythonPackage rec {
21 pname = "drf-yasg";
22 version = "1.21.10";
23 pyproject = true;
24
25 src = fetchPypi {
26 inherit pname version;
27 hash = "sha256-+G1Q+u48MfzsRUWYWocfgyNmx/tbd7YsSAidVuz0+NQ=";
28 };
29
30 postPatch = ''
31 # https://github.com/axnsan12/drf-yasg/pull/710
32 sed -i "/packaging/d" requirements/base.txt
33 '';
34
35 build-system = [
36 setuptools
37 setuptools-scm
38 ];
39
40 dependencies = [
41 django
42 djangorestframework
43 inflection
44 packaging
45 pytz
46 pyyaml
47 uritemplate
48 ];
49
50 nativeCheckInputs = [
51 pytestCheckHook
52 pytest-django
53 datadiff
54 dj-database-url
55 ];
56
57 env.DJANGO_SETTINGS_MODULE = "testproj.settings.local";
58
59 preCheck = ''
60 cd testproj
61 '';
62
63 # a lot of libraries are missing
64 doCheck = false;
65
66 pythonImportsCheck = [ "drf_yasg" ];
67
68 meta = with lib; {
69 description = "Generation of Swagger/OpenAPI schemas for Django REST Framework";
70 homepage = "https://github.com/axnsan12/drf-yasg";
71 maintainers = [ ];
72 license = licenses.bsd3;
73 };
74}