diff options
| author | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2025-12-09 06:37:14 +0000 |
|---|---|---|
| committer | Po-Chuan Hsieh <sunpoet@FreeBSD.org> | 2025-12-09 11:20:49 +0000 |
| commit | e8d50a3f5adef8f76bae8ce71c5ad9002c77eda9 (patch) | |
| tree | 8e7008355977378ce8a907eb753ca35185ec9eae | |
| parent | 1d001d997ad1bebc001b58928490a24153cc600c (diff) | |
devel/py-protoc-gen-validate: Add py-protoc-gen-validate 1.2.1
While protocol buffers effectively guarantee the types of structured data, they
cannot enforce semantic rules for values. This package is a python
implementation of protoc-gen-validate, which allows for runtime validation of
various semantic assertions expressed as annotations on the protobuf schema. The
syntax for all available annotations is in validate.proto. Implemented Python
annotations are listed in the rules comparison.
| -rw-r--r-- | devel/Makefile | 1 | ||||
| -rw-r--r-- | devel/py-protoc-gen-validate/Makefile | 28 | ||||
| -rw-r--r-- | devel/py-protoc-gen-validate/distinfo | 3 | ||||
| -rw-r--r-- | devel/py-protoc-gen-validate/files/patch-setup.cfg | 11 | ||||
| -rw-r--r-- | devel/py-protoc-gen-validate/pkg-descr | 6 |
5 files changed, 49 insertions, 0 deletions
diff --git a/devel/Makefile b/devel/Makefile index 40e9dcd3490a..cc66c90be9d1 100644 --- a/devel/Makefile +++ b/devel/Makefile @@ -5591,6 +5591,7 @@ SUBDIR += py-proto-plus SUBDIR += py-protobuf SUBDIR += py-protobuf-compiler + SUBDIR += py-protoc-gen-validate SUBDIR += py-protovalidate SUBDIR += py-proxmoxer SUBDIR += py-psygnal diff --git a/devel/py-protoc-gen-validate/Makefile b/devel/py-protoc-gen-validate/Makefile new file mode 100644 index 000000000000..a9a5bdcc0842 --- /dev/null +++ b/devel/py-protoc-gen-validate/Makefile @@ -0,0 +1,28 @@ +PORTNAME= protoc-gen-validate +PORTVERSION= 1.2.1 +CATEGORIES= devel python +MASTER_SITES= PYPI +PKGNAMEPREFIX= ${PYTHON_PKGNAMEPREFIX} +DISTNAME= protoc_gen_validate-${PORTVERSION} + +MAINTAINER= sunpoet@FreeBSD.org +COMMENT= PGV for python via just-in-time code generation +WWW= https://github.com/bufbuild/protoc-gen-validate/tree/main/python \ + https://github.com/bufbuild/protoc-gen-validate + +LICENSE= APACHE20 +LICENSE_FILE= ${WRKSRC}/LICENSE + +BUILD_DEPENDS= ${PYTHON_PKGNAMEPREFIX}setuptools>=45:devel/py-setuptools@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}setuptools-scm>=6.2:devel/py-setuptools-scm@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}wheel>=0.38.1:devel/py-wheel@${PY_FLAVOR} +RUN_DEPENDS= ${PYTHON_PKGNAMEPREFIX}Jinja2>=2.11.1:devel/py-Jinja2@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}protobuf>=5.27.0,1:devel/py-protobuf@${PY_FLAVOR} \ + ${PYTHON_PKGNAMEPREFIX}validate_email>=1.3:mail/py-validate_email@${PY_FLAVOR} + +USES= python +USE_PYTHON= autoplist concurrent pep517 + +NO_ARCH= yes + +.include <bsd.port.mk> diff --git a/devel/py-protoc-gen-validate/distinfo b/devel/py-protoc-gen-validate/distinfo new file mode 100644 index 000000000000..4a9e96ad499d --- /dev/null +++ b/devel/py-protoc-gen-validate/distinfo @@ -0,0 +1,3 @@ +TIMESTAMP = 1765032626 +SHA256 (protoc_gen_validate-1.2.1.tar.gz) = 62cd74043e49a34346a3fe7a7fe39e8adce69b19edc99b4d8d410c02a727d552 +SIZE (protoc_gen_validate-1.2.1.tar.gz) = 18160 diff --git a/devel/py-protoc-gen-validate/files/patch-setup.cfg b/devel/py-protoc-gen-validate/files/patch-setup.cfg new file mode 100644 index 000000000000..6bb63690348d --- /dev/null +++ b/devel/py-protoc-gen-validate/files/patch-setup.cfg @@ -0,0 +1,11 @@ +--- setup.cfg.orig 2025-01-22 20:45:00 UTC ++++ setup.cfg +@@ -27,7 +27,7 @@ python_requires = >=3.9 + python_requires = >=3.9 + + [options.data_files] +-data = validate.proto ++share/protoc-gen-validate = validate.proto + + [flake8] + max-line-length = 120 diff --git a/devel/py-protoc-gen-validate/pkg-descr b/devel/py-protoc-gen-validate/pkg-descr new file mode 100644 index 000000000000..8f255f059e35 --- /dev/null +++ b/devel/py-protoc-gen-validate/pkg-descr @@ -0,0 +1,6 @@ +While protocol buffers effectively guarantee the types of structured data, they +cannot enforce semantic rules for values. This package is a python +implementation of protoc-gen-validate, which allows for runtime validation of +various semantic assertions expressed as annotations on the protobuf schema. The +syntax for all available annotations is in validate.proto. Implemented Python +annotations are listed in the rules comparison. |
