From 668a0f9dd8baa2fb6275ff0e022b6f1bf390b7c2 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Mon, 30 Oct 2023 19:32:26 +0800 Subject: [PATCH 1/2] pyodbc: Fix segmentation fault 4.0.36 included a change to decimal parsing[1] that requires the decimal module. Trying to load the pyodbc module without python3-decimal installed would lead to a segmentation fault. This adds python3-decimal as a dependency. This also adds python3-uuid as a dependency as the module can accept and return uuid objects[2]. [1]: https://github.com/mkleehammer/pyodbc/commit/6b107a2bcaf7379e5ba182007b6ecae1bc2fc931 [2]: https://github.com/mkleehammer/pyodbc/commit/2ad7a9ced7c9c33232c173668c0830a484cc92f3 Fixes: f02f3ee8c768 ("pyodbc: Update to 4.0.39") Signed-off-by: Jeffery To --- lang/python/pyodbc/Makefile | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lang/python/pyodbc/Makefile b/lang/python/pyodbc/Makefile index 4f10f91ec..6c8fca8c4 100644 --- a/lang/python/pyodbc/Makefile +++ b/lang/python/pyodbc/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=pyodbc PKG_VERSION:=4.0.39 -PKG_RELEASE:=1 +PKG_RELEASE:=2 PYPI_NAME:=$(PKG_NAME) PKG_HASH:=e528bb70dd6d6299ee429868925df0866e3e919c772b9eff79c8e17920d8f116 @@ -27,7 +27,7 @@ define Package/python3-pyodbc SUBMENU:=Python TITLE:=python3-pyodbc URL:=https://github.com/mkleehammer/pyodbc - DEPENDS:=+unixodbc +python3-light +libstdcpp + DEPENDS:=+unixodbc +python3-light +python3-decimal +python3-uuid +libstdcpp endef define Package/python3-pyodbc/description From d6d9763e31e0e81f8f1fe9fb63c1f9267391bfb0 Mon Sep 17 00:00:00 2001 From: Jeffery To Date: Mon, 30 Oct 2023 20:02:46 +0800 Subject: [PATCH 2/2] pyodbc: Update to 5.0.1, rename source package This renames the source package to python-pyodbc to match other Python packages. This also updates the unixodbc dependency to libodbc, updates the package title and description, and adds a test.sh script for the packages feed CI. Signed-off-by: Jeffery To --- .../python/{pyodbc => python-pyodbc}/Makefile | 23 ++++++++++--------- lang/python/python-pyodbc/test.sh | 5 ++++ 2 files changed, 17 insertions(+), 11 deletions(-) rename lang/python/{pyodbc => python-pyodbc}/Makefile (55%) create mode 100644 lang/python/python-pyodbc/test.sh diff --git a/lang/python/pyodbc/Makefile b/lang/python/python-pyodbc/Makefile similarity index 55% rename from lang/python/pyodbc/Makefile rename to lang/python/python-pyodbc/Makefile index 6c8fca8c4..6357d4bd6 100644 --- a/lang/python/pyodbc/Makefile +++ b/lang/python/python-pyodbc/Makefile @@ -4,17 +4,18 @@ include $(TOPDIR)/rules.mk -PKG_NAME:=pyodbc -PKG_VERSION:=4.0.39 -PKG_RELEASE:=2 +PKG_NAME:=python-pyodbc +PKG_VERSION:=5.0.1 +PKG_RELEASE:=1 -PYPI_NAME:=$(PKG_NAME) -PKG_HASH:=e528bb70dd6d6299ee429868925df0866e3e919c772b9eff79c8e17920d8f116 +PYPI_NAME:=pyodbc +PKG_HASH:=03d7d0b04d5a9156099ce8d03e92f3956783746fa9234eb6f5b5cfc12b645011 PKG_LICENSE:=MIT PKG_LICENSE_FILES:=LICENSE.txt PKG_MAINTAINER:=Jeffery To +# for odbc_config PKG_BUILD_DEPENDS:=unixodbc/host include ../pypi.mk @@ -25,17 +26,17 @@ define Package/python3-pyodbc SECTION:=lang CATEGORY:=Languages SUBMENU:=Python - TITLE:=python3-pyodbc + TITLE:=DB API module for ODBC URL:=https://github.com/mkleehammer/pyodbc - DEPENDS:=+unixodbc +python3-light +python3-decimal +python3-uuid +libstdcpp + DEPENDS:=+python3-light +python3-decimal +python3-uuid +libodbc +libstdcpp endef define Package/python3-pyodbc/description -DB API Module for ODBC - -A Python DB API 2 module for ODBC. This project provides an up-to-date, -convenient interface to ODBC using native data types like datetime and decimal. +pyodbc is an open source Python module that makes accessing ODBC +databases simple. It implements the DB API 2.0 specification but is +packed with even more Pythonic convenience. endef $(eval $(call Py3Package,python3-pyodbc)) $(eval $(call BuildPackage,python3-pyodbc)) +# no src package - the module does not contain any Python code diff --git a/lang/python/python-pyodbc/test.sh b/lang/python/python-pyodbc/test.sh new file mode 100644 index 000000000..f6cf04b11 --- /dev/null +++ b/lang/python/python-pyodbc/test.sh @@ -0,0 +1,5 @@ +#!/bin/sh + +[ "$1" = python3-pyodbc ] || exit 0 + +python3 -c 'import pyodbc'