From d090b03d1e5191814a3ac6099bbe6c9beb6fff99 Mon Sep 17 00:00:00 2001 From: Alexandru Ardelean Date: Sat, 4 Apr 2026 21:22:25 +0300 Subject: [PATCH] python-sqlalchemy: bump to 2.0.49 Changelog: https://docs.sqlalchemy.org/en/20/changelog/changelog_20.html Patch release (resets PKG_RELEASE to 1). Add test.sh to verify ORM and core SQL functionality. Signed-off-by: Alexandru Ardelean --- lang/python/python-sqlalchemy/Makefile | 6 ++--- lang/python/python-sqlalchemy/test.sh | 35 ++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 3 deletions(-) create mode 100755 lang/python/python-sqlalchemy/test.sh diff --git a/lang/python/python-sqlalchemy/Makefile b/lang/python/python-sqlalchemy/Makefile index 15a73a3dd8..e2d08e1d56 100644 --- a/lang/python/python-sqlalchemy/Makefile +++ b/lang/python/python-sqlalchemy/Makefile @@ -8,11 +8,11 @@ include $(TOPDIR)/rules.mk PKG_NAME:=python-sqlalchemy -PKG_VERSION:=2.0.44 -PKG_RELEASE:=2 +PKG_VERSION:=2.0.49 +PKG_RELEASE:=1 PYPI_NAME:=sqlalchemy -PKG_HASH:=0ae7454e1ab1d780aee69fd2aae7d6b8670a581d8847f2d1e0f7ddfbf47e5a22 +PKG_HASH:=d15950a57a210e36dd4cec1aac22787e2a4d57ba9318233e2ef8b2daf9ff2d5f PKG_MAINTAINER:=Josef Schlehofer PKG_LICENSE:=MIT diff --git a/lang/python/python-sqlalchemy/test.sh b/lang/python/python-sqlalchemy/test.sh new file mode 100755 index 0000000000..4e102c37b3 --- /dev/null +++ b/lang/python/python-sqlalchemy/test.sh @@ -0,0 +1,35 @@ +#!/bin/sh +[ "$1" = python3-sqlalchemy ] || exit 0 +python3 - << 'EOF' +import sqlalchemy +assert sqlalchemy.__version__, "sqlalchemy version is empty" + +from sqlalchemy import create_engine, Column, Integer, String, text +from sqlalchemy.orm import DeclarativeBase, Session + +engine = create_engine("sqlite:///:memory:") + +class Base(DeclarativeBase): + pass + +class User(Base): + __tablename__ = "users" + id = Column(Integer, primary_key=True) + name = Column(String) + +Base.metadata.create_all(engine) + +with Session(engine) as session: + session.add(User(name="Alice")) + session.add(User(name="Bob")) + session.commit() + users = session.query(User).order_by(User.name).all() + assert len(users) == 2 + assert users[0].name == "Alice" + assert users[1].name == "Bob" + +with engine.connect() as conn: + result = conn.execute(text("SELECT count(*) FROM users")) + count = result.scalar() + assert count == 2, f"Expected 2, got {count}" +EOF