diff --git a/pkgs/development/python-modules/drf-spectacular/default.nix b/pkgs/development/python-modules/drf-spectacular/default.nix new file mode 100644 index 000000000000..8e41d24c9e1b --- /dev/null +++ b/pkgs/development/python-modules/drf-spectacular/default.nix @@ -0,0 +1,77 @@ +{ lib +, buildPythonPackage +, fetchFromGitHub +, dj-rest-auth +, django +, django-allauth +, django-filter +, django-oauth-toolkit +, django-polymorphic +, django-rest-auth +, django-rest-polymorphic +, djangorestframework +, djangorestframework-camel-case +, djangorestframework-dataclasses +, djangorestframework-recursive +, djangorestframework-simplejwt +, drf-jwt +, drf-nested-routers +, drf-spectacular-sidecar +, inflection +, jsonschema +, psycopg2 +, pytest-django +, pytestCheckHook +, pyyaml +, uritemplate +}: + +buildPythonPackage rec { + pname = "drf-spectacular"; + version = "0.22.1"; + + src = fetchFromGitHub { + owner = "tfranzel"; + repo = "drf-spectacular"; + rev = version; + sha256 = "sha256-SgzyIzgFBXsNHfY2OfCq0LhJyi/ZCOSA8QveKNduIBc="; + }; + + propagatedBuildInputs = [ + django + djangorestframework + inflection + jsonschema + pyyaml + uritemplate + ]; + + checkInputs = [ + dj-rest-auth + django-allauth + django-filter + django-oauth-toolkit + django-polymorphic + django-rest-auth + django-rest-polymorphic + djangorestframework-camel-case + djangorestframework-dataclasses + djangorestframework-recursive + djangorestframework-simplejwt + drf-jwt + drf-nested-routers + drf-spectacular-sidecar + psycopg2 + pytest-django + pytestCheckHook + ]; + + pythonImportsCheck = [ "drf_spectacular" ]; + + meta = with lib; { + description = "Sane and flexible OpenAPI 3 schema generation for Django REST framework"; + homepage = "https://github.com/tfranzel/drf-spectacular"; + license = licenses.bsd3; + maintainers = with maintainers; [ SuperSandro2000 ]; + }; +} diff --git a/pkgs/top-level/python-packages.nix b/pkgs/top-level/python-packages.nix index 2fe618420d6f..3d4ff7c5ebb8 100644 --- a/pkgs/top-level/python-packages.nix +++ b/pkgs/top-level/python-packages.nix @@ -2548,6 +2548,8 @@ in { drf-nested-routers = callPackage ../development/python-modules/drf-nested-routers { }; + drf-spectacular = callPackage ../development/python-modules/drf-spectacular { }; + drf-spectacular-sidecar = callPackage ../development/python-modules/drf-spectacular-sidecar { }; drf-yasg = callPackage ../development/python-modules/drf-yasg { };