From f11dda94ade65cb99c73310091b6ab06c7004aeea23792d283fe5a99a1e3b5cc Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Mark=C3=A9ta=20Machov=C3=A1?= Date: Thu, 10 Apr 2025 13:51:07 +0000 Subject: [PATCH] Accepting request 1268389 from home:glaubitz:branches:devel:languages:python - Update to 2.9.10 * Add support for Python 3.13. * Receive notifications on commit (ticket #1728). * Errorcodes map and errors classes updated to PostgreSQL 17. * Drop support for Python 3.7. - Drop support-python-313.patch, merged upstream OBS-URL: https://build.opensuse.org/request/show/1268389 OBS-URL: https://build.opensuse.org/package/show/devel:languages:python/python-psycopg2?expand=0&rev=100 --- psycopg2-2.9.10.tar.gz | 3 ++ psycopg2-2.9.9.tar.gz | 3 -- python-psycopg2.changes | 10 +++++ python-psycopg2.spec | 6 +-- support-python-313.patch | 81 ---------------------------------------- 5 files changed, 15 insertions(+), 88 deletions(-) create mode 100644 psycopg2-2.9.10.tar.gz delete mode 100644 psycopg2-2.9.9.tar.gz delete mode 100644 support-python-313.patch diff --git a/psycopg2-2.9.10.tar.gz b/psycopg2-2.9.10.tar.gz new file mode 100644 index 0000000..30c97f9 --- /dev/null +++ b/psycopg2-2.9.10.tar.gz @@ -0,0 +1,3 @@ +version https://git-lfs.github.com/spec/v1 +oid sha256:12ec0b40b0273f95296233e8750441339298e6a572f7039da5b260e3c8b60e11 +size 385672 diff --git a/psycopg2-2.9.9.tar.gz b/psycopg2-2.9.9.tar.gz deleted file mode 100644 index ff74968..0000000 --- a/psycopg2-2.9.9.tar.gz +++ /dev/null @@ -1,3 +0,0 @@ -version https://git-lfs.github.com/spec/v1 -oid sha256:d1454bde93fb1e224166811694d600e746430c006fbb031ea06ecc2ea41bf156 -size 384926 diff --git a/python-psycopg2.changes b/python-psycopg2.changes index d4c8550..13cf9b5 100644 --- a/python-psycopg2.changes +++ b/python-psycopg2.changes @@ -1,3 +1,13 @@ +------------------------------------------------------------------- +Thu Apr 10 12:25:48 UTC 2025 - John Paul Adrian Glaubitz + +- Update to 2.9.10 + * Add support for Python 3.13. + * Receive notifications on commit (ticket #1728). + * Errorcodes map and errors classes updated to PostgreSQL 17. + * Drop support for Python 3.7. +- Drop support-python-313.patch, merged upstream + ------------------------------------------------------------------- Tue Oct 29 05:08:18 UTC 2024 - Steve Kowalik diff --git a/python-psycopg2.spec b/python-psycopg2.spec index b846ec8..8aafb2e 100644 --- a/python-psycopg2.spec +++ b/python-psycopg2.spec @@ -1,7 +1,7 @@ # # spec file for package python-psycopg2 # -# Copyright (c) 2024 SUSE LLC +# Copyright (c) 2025 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -18,14 +18,12 @@ %{?sle15_python_module_pythons} Name: python-psycopg2 -Version: 2.9.9 +Version: 2.9.10 Release: 0 Summary: Python-PostgreSQL Database Adapter License: LGPL-3.0-or-later AND (LGPL-3.0-or-later OR ZPL-2.0) AND SUSE-GPL-2.0-with-openssl-exception URL: https://www.psycopg.org/ Source: https://files.pythonhosted.org/packages/source/p/psycopg2/psycopg2-%{version}.tar.gz -# PATCH-FIX-UPSTREAM gh#psycopg/psycopg2#1695 -Patch0: support-python-313.patch BuildRequires: %{python_module devel >= 3.7} BuildRequires: %{python_module pip} BuildRequires: %{python_module setuptools} diff --git a/support-python-313.patch b/support-python-313.patch deleted file mode 100644 index 5464e1a..0000000 --- a/support-python-313.patch +++ /dev/null @@ -1,81 +0,0 @@ -From 829a7a2be93f5d0fb1edbc0feb104181f208efc6 Mon Sep 17 00:00:00 2001 -From: Karolina Surma -Date: Wed, 24 Apr 2024 09:50:32 +0200 -Subject: [PATCH 1/6] _PyInterpreterState_Get() has become public in Python - 3.13 - -Since 3.13.0a1 it has been renamed to PyInterpreterStateGet() -Source: https://github.com/python/cpython/pull/106321 ---- - psycopg/utils.c | 5 ++++- - 1 file changed, 4 insertions(+), 1 deletion(-) - -diff --git a/psycopg/utils.c b/psycopg/utils.c -index 16be9062a..1dfb87d0b 100644 ---- a/psycopg/utils.c -+++ b/psycopg/utils.c -@@ -392,7 +392,10 @@ psyco_set_error(PyObject *exc, cursorObject *curs, const char *msg) - static int - psyco_is_main_interp(void) - { --#if PY_VERSION_HEX >= 0x03080000 -+#if PY_VERSION_HEX >= 0x030d0000 -+ /* tested with Python 3.13.0a6 */ -+ return PyInterpreterState_Get() == PyInterpreterState_Main(); -+#elif PY_VERSION_HEX >= 0x03080000 - /* tested with Python 3.8.0a2 */ - return _PyInterpreterState_Get() == PyInterpreterState_Main(); - #else - -From 3b9aa7cf9f3b000407dc0ee8e77fbcf54fa04d7f Mon Sep 17 00:00:00 2001 -From: Karolina Surma -Date: Wed, 24 Apr 2024 09:56:08 +0200 -Subject: [PATCH 2/6] Fix tests with Python 3.13 - -The textual representation of addresses has changed, adapt the code to -expect different values on Python 3.13+. -See: https://github.com/python/cpython/commit/f22bf8e3cf899896cf587099d292 ---- - tests/test_ipaddress.py | 15 +++++++++++++-- - 1 file changed, 13 insertions(+), 2 deletions(-) - -diff --git a/tests/test_ipaddress.py b/tests/test_ipaddress.py -index 4a2339ef9..3f8036900 100755 ---- a/tests/test_ipaddress.py -+++ b/tests/test_ipaddress.py -@@ -18,6 +18,7 @@ - - from . import testutils - import unittest -+import sys - - import psycopg2 - import psycopg2.extras -@@ -68,7 +69,12 @@ def test_inet_adapt(self): - self.assertEquals(cur.fetchone()[0], '127.0.0.1/24') - - cur.execute("select %s", [ip.ip_interface('::ffff:102:300/128')]) -- self.assertEquals(cur.fetchone()[0], '::ffff:102:300/128') -+ -+ # The texual representation of addresses has changed in Python 3.13 -+ if sys.version_info >= (3, 13): -+ self.assertEquals(cur.fetchone()[0], '::ffff:1.2.3.0/128') -+ else: -+ self.assertEquals(cur.fetchone()[0], '::ffff:102:300/128') - - @testutils.skip_if_crdb("cidr") - def test_cidr_cast(self): -@@ -109,7 +115,12 @@ def test_cidr_adapt(self): - self.assertEquals(cur.fetchone()[0], '127.0.0.0/24') - - cur.execute("select %s", [ip.ip_network('::ffff:102:300/128')]) -- self.assertEquals(cur.fetchone()[0], '::ffff:102:300/128') -+ -+ # The texual representation of addresses has changed in Python 3.13 -+ if sys.version_info >= (3, 13): -+ self.assertEquals(cur.fetchone()[0], '::ffff:1.2.3.0/128') -+ else: -+ self.assertEquals(cur.fetchone()[0], '::ffff:102:300/128') - - - def test_suite():