Unverified Commit 8d87346f authored by Martin Weinelt's avatar Martin Weinelt Committed by GitHub
Browse files

Merge pull request #271927 from mweinelt/psycopg-3.1.14

python311Packages.psycopg: 3.1.13 -> 3.1.14
parents 23eb27c2 bca98d95
Loading
Loading
Loading
Loading
+20 −11
Original line number Diff line number Diff line
diff --git a/psycopg/psycopg/pq/_pq_ctypes.py b/psycopg/psycopg/pq/_pq_ctypes.py
index 4f9d00fb..24b90ef6 100644
index 9ca1d129..02929ab6 100644
--- a/psycopg/psycopg/pq/_pq_ctypes.py
+++ b/psycopg/psycopg/pq/_pq_ctypes.py
@@ -11,14 +11,10 @@ from ctypes import Structure, CFUNCTYPE, POINTER
@@ -30,17 +30,26 @@ index 4f9d00fb..24b90ef6 100644
     fdopen = libc.fdopen
     fdopen.argtypes = (c_int, c_char_p)
diff --git a/tests/fix_pq.py b/tests/fix_pq.py
index 6811a26c..c1829c82 100644
index 917dfc91..505f2d65 100644
--- a/tests/fix_pq.py
+++ b/tests/fix_pq.py
@@ -51,9 +51,7 @@ def libpq():
         from psycopg.pq.misc import find_libpq_full_path
 
         # Not available when testing the binary package
@@ -47,18 +47,7 @@ def pytest_runtest_setup(item):
 @pytest.fixture
 def libpq():
     """Return a ctypes wrapper to access the libpq."""
-    try:
-        from psycopg.pq.misc import find_libpq_full_path
-
-        # Not available when testing the binary package
-        libname = find_libpq_full_path()
-        assert libname, "libpq libname not found"
-        return ctypes.pydll.LoadLibrary(libname)
+        return ctypes.pydll.LoadLibrary("@libpq@")
     except Exception as e:
         if pq.__impl__ == "binary":
             pytest.skip(f"can't load libpq for testing: {e}")
-        return ctypes.cdll.LoadLibrary(libname)
-    except Exception as e:
-        if pq.__impl__ == "binary":
-            pytest.skip(f"can't load libpq for testing: {e}")
-        else:
-            raise
+    return ctypes.cdll.LoadLibrary("@libpq@")
 
 
 @pytest.fixture
+6 −8
Original line number Diff line number Diff line
@@ -35,13 +35,13 @@

let
  pname = "psycopg";
  version = "3.1.13";
  version = "3.1.14";

  src = fetchFromGitHub {
    owner = "psycopg";
    repo = pname;
    rev = "refs/tags/${version}";
    hash = "sha256-N+x8RErlId1uBgXZjBBjtPxqJXGuXZEl78DKVKjhy9w=";
    hash = "sha256-zocRBnrQoJDWI4qhxDnxxIeiLdaWolvsujqfHBYQc/A=";
  };

  patches = [
@@ -52,11 +52,9 @@ let
    })

    (fetchpatch {
      # fix environment variables leaking into test environment
      # https://github.com/psycopg/psycopg/pull/683
      # https://github.com/psycopg/psycopg/issues/681
      url = "https://github.com/psycopg/psycopg/commit/f060855aa6126e811de243c7213d2caff9c88123.patch";
      hash = "sha256-QsFxK8Qasw9kbNCUUCqbOHaf53kT5NONlr28vGoPda0=";
      # add fixture to mark flaky ref count tests
      url = "https://github.com/psycopg/psycopg/commit/70ef364324ba3448ef9ac0e29329c9d802380e4b.patch";
      hash = "sha256-8PlrBcIumlxFjNXCAfm4NpSIxAnvLR8TopHzneJyzf0=";
    })
  ];

@@ -214,7 +212,7 @@ buildPythonPackage rec {

  pytestFlagsArray = [
    "-o" "cache_dir=$TMPDIR"
    "-m" "'not timing'"
    "-m" "'not refcount and not timing'"
  ];

  postCheck = ''