From 9a37e0df7be5ca02b3b7775af236cc6b3fc1f7a9 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Thu, 1 May 2025 20:28:45 +0200 Subject: [PATCH] python313Packages.psycopg: 3.2.6 -> 3.2.7 https://github.com/psycopg/psycopg/blob/3.2.7/docs/news.rst#current-release --- .../python-modules/psycopg/ctypes.patch | 20 +++++++++---------- .../python-modules/psycopg/default.nix | 4 ++-- 2 files changed, 11 insertions(+), 13 deletions(-) diff --git a/pkgs/development/python-modules/psycopg/ctypes.patch b/pkgs/development/python-modules/psycopg/ctypes.patch index 98a6ba080f78..2863c9bfbfc2 100644 --- a/pkgs/development/python-modules/psycopg/ctypes.patch +++ b/pkgs/development/python-modules/psycopg/ctypes.patch @@ -1,30 +1,28 @@ diff --git a/psycopg/psycopg/pq/_pq_ctypes.py b/psycopg/psycopg/pq/_pq_ctypes.py -index f3a7b143..1bf935fb 100644 +index 99e49357..3827d6dd 100644 --- a/psycopg/psycopg/pq/_pq_ctypes.py +++ b/psycopg/psycopg/pq/_pq_ctypes.py -@@ -13,14 +13,11 @@ from ctypes import Structure, CFUNCTYPE, POINTER - from ctypes import c_char, c_char_p, c_int, c_size_t, c_ubyte, c_uint, c_void_p +@@ -13,13 +13,10 @@ from ctypes import CFUNCTYPE, POINTER, Structure, c_char, c_char_p, c_int, c_siz + from ctypes import c_ubyte, c_uint, c_void_p from typing import Any, NoReturn -from .misc import find_libpq_full_path, version_pretty +from .misc import version_pretty from ..errors import NotSupportedError --libname = find_libpq_full_path() --if not libname: +-if not (libname := find_libpq_full_path()): - raise ImportError("libpq library not found") - +- -pq = ctypes.cdll.LoadLibrary(libname) +pq = ctypes.cdll.LoadLibrary("@libpq@") class FILE(Structure): -@@ -30,12 +27,7 @@ class FILE(Structure): +@@ -29,11 +26,7 @@ class FILE(Structure): FILE_ptr = POINTER(FILE) if sys.platform == "linux": -- libcname = ctypes.util.find_library("c") -- if not libcname: +- if not (libcname := ctypes.util.find_library("c")): - # Likely this is a system using musl libc, see the following bug: - # https://github.com/python/cpython/issues/65821 - libcname = "libc.so" @@ -34,10 +32,10 @@ index f3a7b143..1bf935fb 100644 fdopen = libc.fdopen fdopen.argtypes = (c_int, c_char_p) diff --git a/tests/fix_pq.py b/tests/fix_pq.py -index 1cff7e18..218d90a0 100644 +index 8d7e9ae6..074be456 100644 --- a/tests/fix_pq.py +++ b/tests/fix_pq.py -@@ -49,18 +49,7 @@ def pytest_runtest_setup(item): +@@ -50,18 +50,7 @@ def pytest_runtest_setup(item): @pytest.fixture def libpq(): """Return a ctypes wrapper to access the libpq.""" diff --git a/pkgs/development/python-modules/psycopg/default.nix b/pkgs/development/python-modules/psycopg/default.nix index 2e5174552fce..e0fe35eda093 100644 --- a/pkgs/development/python-modules/psycopg/default.nix +++ b/pkgs/development/python-modules/psycopg/default.nix @@ -35,13 +35,13 @@ let pname = "psycopg"; - version = "3.2.6"; + version = "3.2.7"; src = fetchFromGitHub { owner = "psycopg"; repo = "psycopg"; tag = version; - hash = "sha256-fCiTu6lKFqY7Yl9KfmhRZQIDg5sEkXkQ95kPfIDSGn8="; + hash = "sha256-v4R+5jgC4dTrL+i6O+UCCr7+g673hKi9YmrSeROLpZs="; }; patches = [