python-pydantic: add version 2.6.4

Python pydantic v2 is fast data validation library, new version uses
some rust code on parsing so having it compiled as a package is easier
than to try to compile it in openwrt device.

Signed-off-by: Ilkka Ollakka <ilkka.ollakka@cloudersolutions.com>
This commit is contained in:
Ilkka Ollakka 2024-03-28 10:49:39 +02:00 committed by Ilkka Ollakka
parent 7e56127fae
commit f96e770469
2 changed files with 53 additions and 0 deletions

View File

@ -0,0 +1,48 @@
#
# Copyright (C) 2024, Clouder Oy
#
# This is free software, licensed under the GNU General Public License v2.
# See /LICENSE for more information.
#
include $(TOPDIR)/rules.mk
PKG_NAME:=python-pydantic
PKG_VERSION:=2.6.4
PKG_RELEASE:=1
PYPI_NAME:=pydantic
PKG_LICENSE:=MIT
PKG_LICENSE_FILES:=LICENSE
PKG_MAINTAINER:=Ilkka Ollakka <ilkka.ollakka@cloudersolutions.com>
PKG_HASH:=b1704e0847db01817624a6b86766967f552dd9dbf3afba4004409f908dcc84e6
include ../pypi.mk
include $(INCLUDE_DIR)/package.mk
include ../python3-package.mk
define Package/python3-pydantic
SECTION:=lang
CATEGORY:=Languages
SUBMENU:=Python
TITLE:=Pydantic
URL:=https://github.com/pydantic/pydantic
DEPENDS:= \
+python3-light \
+python3-typing-extensions \
+python3-annotated-types \
+python3-pydantic-core
endef
define Package/python3-pydantic/description
Data validation using Python type hints.
Fast and extensible, Pydantic plays nicely with your linters/IDE/brain.
Define how data should be in pure, canonical Python 3.8+;
validate it with Pydantic.
endef
$(eval $(call Py3Package,python3-pydantic))
$(eval $(call BuildPackage,python3-pydantic))
$(eval $(call BuildPackage,python3-pydantic-src))

View File

@ -0,0 +1,5 @@
#!/bin/sh
[ "$1" = python3-pydantic ] || exit 0
python3 -c 'from pydantic import (BaseModel, Field, Json, TypeAdapter)'