From nobody Thu May 04 11:58:42 2023 X-Original-To: dev-commits-ports-main@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4QBsm23cT8z492MV; Thu, 4 May 2023 11:58:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4QBsm22mKNz4Qwm; Thu, 4 May 2023 11:58:42 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683201522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zVNSdS7CtARLYV7GG3iFp7edmJGABUuoptbnL/XDGz8=; b=hMS1trQKghPDhgpWXj7C4jlPpAsxXyXISlyb19l2knwAwKHVzgApAz+0dX/1KTdP/IORNW Nn0BPGjFA10MAwqInMiXoAZVVXWHi7H86jSDaUTdvNDycmCTVkevW+DHvLg4u2ugJRoCl6 POZJWFP11ol91Nw8t5kvaHzIDoboXOZzKO5jyVAzIY7kzevTHAUTjEHhpf49nuH3/pxV5b 4VvPWFDAWt/zEzhZKd4YOBQQAoZjoLK8FNr80Bk0W7Bs5OnfjW4ui3vBK4KWCjhRzpZjmF 2zNsyHnrKUkPcMxwaAoyztwLkCs0cELcmc+D2wzo1F5u9V42mkMg6hCQ8Rk/sQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1683201522; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=zVNSdS7CtARLYV7GG3iFp7edmJGABUuoptbnL/XDGz8=; b=T3QraskM4uPi3KJGPcAqpup92+E3j+rc3EksX0JJUTNUKAoGCYuiv7txR1Ah5l5uksHcYv A/2C4DdK+A6qHza4+A5OYwsxYX5d2U2s4fcN2XAF7RqfPQ2Hdc6rapcluEOVm4ipYXm7HI UOovxE8+1wYBsgFlwqjlv2wP+fmFKGcyVrcoIefvSzdJFz8ZLehx3fvazUzmYzbfZR3xnl W0R57s1EIIh/Dh+Thkw0RIVilwy9cGLRG1TOT6VzXO8+S0kUHbMGhyUt2w8Ij7x7YgThEN 2zmF5UuljODmWoFYRPsrn2E7fWCQN2yZy9J8SEfmx7rnst/t8vKUgCAxAW8LYg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1683201522; a=rsa-sha256; cv=none; b=BzNeRH9xf/BydUo9+cZeiHhoISNDspvf06fdOJqM2sdRnxeBcxd3bZ1Haez/LT8ZwSSxSW ujAiOEm3eGtsWUwk3JqsB9Ytyha5R2ZSkihp4ZOAw62XgdY+TYBNn3EUviSJJkNZ4PWnCh cvikhANrKlII1uQiVgbSkcQEl9vAn1giKihnnkZgHZRsFAVeY3dPsuAz9c4ZvCyFpeq+7G y1LoT62OWs5dGFPufQB4FZ1vETXT89Ilss+4xxM6Zro+bPH5HtKKWRriYsQDslC0mnL6z9 wIvtU8aQbOkkZ5vfpgI2dDw8oqk4hlcvIyewiQp1BgxDOCpCgRKf4tm/BAhBug== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4QBsm21qy0z19Xd; Thu, 4 May 2023 11:58:42 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 344Bwgm8088903; Thu, 4 May 2023 11:58:42 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 344Bwgw1088902; Thu, 4 May 2023 11:58:42 GMT (envelope-from git) Date: Thu, 4 May 2023 11:58:42 GMT Message-Id: <202305041158.344Bwgw1088902@gitrepo.freebsd.org> To: ports-committers@FreeBSD.org, dev-commits-ports-all@FreeBSD.org, dev-commits-ports-main@FreeBSD.org From: Kai Knoblich Subject: git: 437b5ef2910a - main - www/py-drf-spectacular: New port List-Id: Commits to the main branch of the FreeBSD ports repository List-Archive: https://lists.freebsd.org/archives/dev-commits-ports-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-ports-main@freebsd.org X-BeenThere: dev-commits-ports-main@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: kai X-Git-Repository: ports X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 437b5ef2910a26f7e4a20b9f9d89c2cc5d15e186 Auto-Submitted: auto-generated X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by kai: URL: https://cgit.FreeBSD.org/ports/commit/?id=437b5ef2910a26f7e4a20b9f9d89c2cc5d15e186 commit 437b5ef2910a26f7e4a20b9f9d89c2cc5d15e186 Author: Kai Knoblich AuthorDate: 2023-05-04 11:33:15 +0000 Commit: Kai Knoblich CommitDate: 2023-05-04 11:57:42 +0000 www/py-drf-spectacular: New port 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-drf-spectacular/Makefile | 40 ++++++++++++++++++++++++++++++++++++++++ www/py-drf-spectacular/distinfo | 3 +++ www/py-drf-spectacular/pkg-descr | 24 ++++++++++++++++++++++++ 4 files changed, 68 insertions(+) diff --git a/www/Makefile b/www/Makefile index c171d8414988..5b5096af654e 100644 --- a/www/Makefile +++ b/www/Makefile @@ -1604,6 +1604,7 @@ SUBDIR += py-djangorestframework-filters SUBDIR += py-djangorestframework-xml SUBDIR += py-draftjs-exporter + SUBDIR += py-drf-spectacular SUBDIR += py-drf-yasg SUBDIR += py-dropbox SUBDIR += py-dtflickr diff --git a/www/py-drf-spectacular/Makefile b/www/py-drf-spectacular/Makefile new file mode 100644 index 000000000000..ff6a3cf56661 --- /dev/null +++ b/www/py-drf-spectacular/Makefile @@ -0,0 +1,40 @@ +PORTNAME= drf-spectacular +DISTVERSION= 0.26.2 +CATEGORIES= www python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} + +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}django32>=2.2:www/py-django32@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}djangorestframework>=3.10.3:www/py-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.6+ +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}drf-spectacular-sidecar>0:www/py-drf-spectacular-sidecar@${PY_FLAVOR} + +.include + +.if ${PYTHON_REL} < 30800 +RUN_DEPENDS+= ${PYTHON_PKGNAMEPREFIX}typing-extension>0:devel/py-typing-extensions@${PY_FLAVOR} +.endif + +.include diff --git a/www/py-drf-spectacular/distinfo b/www/py-drf-spectacular/distinfo new file mode 100644 index 000000000000..a186bafeb897 --- /dev/null +++ b/www/py-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-drf-spectacular/pkg-descr b/www/py-drf-spectacular/pkg-descr new file mode 100644 index 000000000000..7f053d6244dc --- /dev/null +++ b/www/py-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