nixpkgs mirror (for testing)
github.com/NixOS/nixpkgs
nix
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.14";
23 pyproject = true;
24
25 src = fetchPypi {
26 inherit version;
27 pname = "drf_yasg";
28 hash = "sha256-aNYtX3UFYRupV3EVyDs2IRzCDZdIpQzpWkSr5BFyfRA=";
29 };
30
31 postPatch = ''
32 substituteInPlace pyproject.toml \
33 --replace-fail "setuptools-scm ~= 7.0" "setuptools-scm >= 7.0"
34 '';
35
36 build-system = [
37 setuptools
38 setuptools-scm
39 ];
40
41 dependencies = [
42 django
43 djangorestframework
44 inflection
45 packaging
46 pytz
47 pyyaml
48 uritemplate
49 ];
50
51 nativeCheckInputs = [
52 pytestCheckHook
53 pytest-django
54 datadiff
55 dj-database-url
56 ];
57
58 env.DJANGO_SETTINGS_MODULE = "testproj.settings.local";
59
60 preCheck = ''
61 cd testproj
62 '';
63
64 # a lot of libraries are missing
65 doCheck = false;
66
67 pythonImportsCheck = [ "drf_yasg" ];
68
69 meta = {
70 description = "Generation of Swagger/OpenAPI schemas for Django REST Framework";
71 homepage = "https://github.com/axnsan12/drf-yasg";
72 maintainers = [ ];
73 license = lib.licenses.bsd3;
74 };
75}