Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 2 Jun 2023 16:19:46 GMT
From:      Kai Knoblich <kai@FreeBSD.org>
To:        ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org
Subject:   git: fb7fd0b40f7e - main - www/py-dj41-drf-spectacular: New port
Message-ID:  <202306021619.352GJkO9060005@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by kai:

URL: https://cgit.FreeBSD.org/ports/commit/?id=fb7fd0b40f7e953086a9aa54b167da7c2a677c2d

commit fb7fd0b40f7e953086a9aa54b167da7c2a677c2d
Author:     Kai Knoblich <kai@FreeBSD.org>
AuthorDate: 2023-06-02 15:49:48 +0000
Commit:     Kai Knoblich <kai@FreeBSD.org>
CommitDate: 2023-06-02 16:19:21 +0000

    www/py-dj41-drf-spectacular: New port
    
    Note: Copied from www/py-drf-spectacular, required for NetBox 3.5.
    
    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:
    
    * Serializers modelled as components. (arbitrary nesting +
      recursion supported)
    * @extend_schema decorator for customization of APIView, Viewsets,
      function-based views, and @action
    * 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, Description extraction from docstrings
    * Request/response/parameter examples, Callback operations
    * Vendor specification extensions (x-*) in info, operations, parameters,
      components, and security schemes
    * Sane fallbacks and 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
---
 www/Makefile                          |  1 +
 www/py-dj41-drf-spectacular/Makefile  | 34 ++++++++++++++++++++++++++++++++++
 www/py-dj41-drf-spectacular/distinfo  |  3 +++
 www/py-dj41-drf-spectacular/pkg-descr | 24 ++++++++++++++++++++++++
 4 files changed, 62 insertions(+)

diff --git a/www/Makefile b/www/Makefile
index 658769bfdbcf..d825eaa42de3 100644
--- a/www/Makefile
+++ b/www/Makefile
@@ -1475,6 +1475,7 @@
     SUBDIR += py-dj41-django-taggit
     SUBDIR += py-dj41-django-timezone-field
     SUBDIR += py-dj41-djangorestframework
+    SUBDIR += py-dj41-drf-spectacular
     SUBDIR += py-dj41-drf-yasg
     SUBDIR += py-django-admin-rangefilter
     SUBDIR += py-django-advanced-filters
diff --git a/www/py-dj41-drf-spectacular/Makefile b/www/py-dj41-drf-spectacular/Makefile
new file mode 100644
index 000000000000..63d92c8d0f5d
--- /dev/null
+++ b/www/py-dj41-drf-spectacular/Makefile
@@ -0,0 +1,34 @@
+PORTNAME=	drf-spectacular
+DISTVERSION=	0.26.2
+CATEGORIES=	www python
+MASTER_SITES=	PYPI
+PKGNAMEPREFIX=	${PYTHON_PKGNAMEPREFIX}dj41-
+
+MAINTAINER=	kai@FreeBSD.org
+COMMENT=	Sane/flexible OpenAPI 3 schema generation for Django REST framework
+WWW=		https://github.com/tfranzel/drf-spectacular
+
+LICENSE=	BSD3CLAUSE
+LICENSE_FILE=	${WRKSRC}/LICENSE
+
+RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}django41>=2.2:www/py-django41@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}dj41-djangorestframework>=3.10.3:www/py-dj41-djangorestframework@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}inflection>=0.3.1:devel/py-inflection@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}jsonschema>=2.6.0:devel/py-jsonschema@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}uritemplate>=2.0.0:net/py-uritemplate@${PY_FLAVOR} \
+		${PYTHON_PKGNAMEPREFIX}yaml>=5.1:devel/py-yaml@${PY_FLAVOR}
+
+USES=		python:3.8+
+USE_PYTHON=	autoplist distutils
+
+CONFLICTS_INSTALL=	${PYTHON_PKGNAMEPREFIX}*${PORTNAME}
+
+NO_ARCH=		yes
+
+OPTIONS_DEFINE=		SIDECAR
+OPTIONS_DEFAULT=	SIDECAR
+
+SIDECAR_DESC=	Enable self-contained Swagger/Redoc UI installation
+SIDECAR_RUN_DEPENDS=	${PYTHON_PKGNAMEPREFIX}dj41-drf-spectacular-sidecar>0:www/py-dj41-drf-spectacular-sidecar@${PY_FLAVOR}
+
+.include <bsd.port.mk>
diff --git a/www/py-dj41-drf-spectacular/distinfo b/www/py-dj41-drf-spectacular/distinfo
new file mode 100644
index 000000000000..a186bafeb897
--- /dev/null
+++ b/www/py-dj41-drf-spectacular/distinfo
@@ -0,0 +1,3 @@
+TIMESTAMP = 1681883936
+SHA256 (drf-spectacular-0.26.2.tar.gz) = 005623d6bb9de37d2d0ec24ccd59c636e4a42f9af252f1470129ac32ccab38cb
+SIZE (drf-spectacular-0.26.2.tar.gz) = 216281
diff --git a/www/py-dj41-drf-spectacular/pkg-descr b/www/py-dj41-drf-spectacular/pkg-descr
new file mode 100644
index 000000000000..7f053d6244dc
--- /dev/null
+++ b/www/py-dj41-drf-spectacular/pkg-descr
@@ -0,0 +1,24 @@
+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:
+
+* Serializers modelled as components. (arbitrary nesting + recursion supported)
+* @extend_schema decorator for customization of APIView, Viewsets,
+  function-based views, and @action
+* 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, Description extraction from docstrings
+* Request/response/parameter examples, Callback operations
+* Vendor specification extensions (x-*) in info, operations, parameters,
+  components, and security schemes
+* Sane fallbacks and 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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202306021619.352GJkO9060005>