From 8e5a20d7ed681e8b670747187e593bd5f2da9465 Mon Sep 17 00:00:00 2001 From: Julien Roy Date: Sun, 26 May 2024 09:05:24 -0400 Subject: dev-python/drf-spectacular: new package, add 0.27.2 Signed-off-by: Julien Roy --- dev-python/drf-spectacular/Manifest | 1 + .../drf-spectacular/drf-spectacular-0.27.2.ebuild | 55 ++++++++++++++++++++++ dev-python/drf-spectacular/metadata.xml | 53 +++++++++++++++++++++ 3 files changed, 109 insertions(+) create mode 100644 dev-python/drf-spectacular/Manifest create mode 100644 dev-python/drf-spectacular/drf-spectacular-0.27.2.ebuild create mode 100644 dev-python/drf-spectacular/metadata.xml diff --git a/dev-python/drf-spectacular/Manifest b/dev-python/drf-spectacular/Manifest new file mode 100644 index 0000000..ed62b70 --- /dev/null +++ b/dev-python/drf-spectacular/Manifest @@ -0,0 +1 @@ +DIST drf-spectacular-0.27.2.tar.gz 235131 BLAKE2B a8d722103f1c3cd8239cba2ab99db800517c8b8d18873a4cd453e51a83226f862834a19cf9ba37385a80d064c6bfea02be7c59e18f5b39fa65801901b87e277e SHA512 c35230498044536a6169f98da7f3073a2a2b7c3101fe2d5d27a3373a3a7ab4335e16ddf5dd587ce322c116ce6025ed8344e611f9cb64dee5c8f5d698dfe35ea5 diff --git a/dev-python/drf-spectacular/drf-spectacular-0.27.2.ebuild b/dev-python/drf-spectacular/drf-spectacular-0.27.2.ebuild new file mode 100644 index 0000000..08994d4 --- /dev/null +++ b/dev-python/drf-spectacular/drf-spectacular-0.27.2.ebuild @@ -0,0 +1,55 @@ +# Copyright 2023-2024 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +EAPI=8 + +PYTHON_COMPAT=( python3_{10..12} ) +DISTUTILS_USE_PEP517=setuptools +PYPI_NO_NORMALIZE=1 + +inherit distutils-r1 pypi + +DESCRIPTION="Sane and flexible OpenAPI 3 schema generation for Django REST framework" +HOMEPAGE=" + https://github.com/tfranzel/drf-spectacular + https://pypi.org/project/drf-spectacular/ +" + +LICENSE="BSD" +SLOT="0" +KEYWORDS="~amd64" + +RDEPEND=" + >=dev-python/django-2.2[${PYTHON_USEDEP}] + dev-python/django-allauth[${PYTHON_USEDEP}] + >=dev-python/django-filter-2.3.0[${PYTHON_USEDEP}] + >=dev-python/django-oauth-toolkit-1.2.0[${PYTHON_USEDEP}] + >=dev-python/django-polymorphic-2.1[${PYTHON_USEDEP}] + >=dev-python/django-rest-knox-4.1[${PYTHON_USEDEP}] + >=dev-python/django-rest-polymorphic-0.1.8[${PYTHON_USEDEP}] + >=dev-python/djangorestframework-3.10.3[${PYTHON_USEDEP}] + >=dev-python/djangorestframework-camel-case-1.1.2[${PYTHON_USEDEP}] + >=dev-python/djangorestframework-dataclasses-1.0.0[${PYTHON_USEDEP}] + >=dev-python/djangorestframework-gis-1.0.0[${PYTHON_USEDEP}] + >=dev-python/djangorestframework-simplejwt-4.4.0[${PYTHON_USEDEP}] + >=dev-python/djangorestframework-recursive-0.1.2[${PYTHON_USEDEP}] + >=dev-python/dj-rest-auth-1.0.0[${PYTHON_USEDEP}] + >=dev-python/drf-jwt-0.13.0[${PYTHON_USEDEP}] + >=dev-python/drf-nested-routers-0.93.3[${PYTHON_USEDEP}] + dev-python/drf-spectacular-sidecar[${PYTHON_USEDEP}] + >=dev-python/inflection-0.3.1[${PYTHON_USEDEP}] + >=dev-python/jsonschema-2.6.0[${PYTHON_USEDEP}] + >=dev-python/psycopg-2.7.3.2[${PYTHON_USEDEP}] + >=dev-python/pydantic-2[${PYTHON_USEDEP}] + =dev-python/pyyaml-5.1[${PYTHON_USEDEP}] + >=dev-python/twine-3.1.1[${PYTHON_USEDEP}] + >=dev-python/uritemplate-2.0.0[${PYTHON_USEDEP}] + + doc? ( dev-python/typing-extensions[${PYTHON_USEDEP}] ) + test? ( >=dev-python/pytest-django-3.8.0[${PYTHON_USEDEP}] ) +" +DEPEND="${RDEPEND}" + +distutils_enable_tests pytest +distutils_enable_sphinx docs diff --git a/dev-python/drf-spectacular/metadata.xml b/dev-python/drf-spectacular/metadata.xml new file mode 100644 index 0000000..685b4bc --- /dev/null +++ b/dev-python/drf-spectacular/metadata.xml @@ -0,0 +1,53 @@ + + + + + Julien Roy + julien@jroy.ca + + +This project has 3 goals: + + Extract as much schema information from DRF as possible. + Provide flexibility to make the schema usable in the real world (not only toy examples). + Generate a schema that works well with the most popular client generators. + +The code is a heavily modified fork of the DRF OpenAPI generator, which is/was lacking all of the below listed features. + +Features + + Serializers modelled as components. (arbitrary nesting and recursion supported) + + @extend_schema decorator for customization of APIView, Viewsets, function-based views, and @action + additional parameters + request/response serializer override (with status codes) + polymorphic responses either manually with PolymorphicProxySerializer helper or via rest_polymorphic's PolymorphicSerializer) + ... and more customization options + + Authentication support (DRF natives included, easily extendable) + Custom serializer class support (easily extendable) + SerializerMethodField() type via type hinting or @extend_schema_field + i18n support + Tags extraction + Request/response/parameter examples + Description extraction from docstrings + Vendor specification extensions (x-*) in info, operations, parameters, components, and security schemes + Sane fallbacks + Sane operation_id naming (based on path) + Schema serving with SpectacularAPIView (Redoc and Swagger-UI views are also available) + Optional input/output serializer component split + Callback operations + OpenAPI 3.1 support (via setting OAS_VERSION) + + + + T. Franzel + tfranzel@gmail.com + + https://github.com/tfranzel/drf-spectacular/issues + https://github.com/tfranzel/drf-spectacular/releases + https://drf-spectacular.readthedocs.io/ + tfranzel/drf-spectacular + drf-spectacular + + -- cgit v1.2.3