From 42d82719f393ebfe75d719164c9f0312d26eb688 Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 3 May 2023 01:19:53 +0200 Subject: [PATCH 1/2] python310Packages.psycopg: 3.1.8 -> 3.1.9 https://github.com/psycopg/psycopg/blob/3.1.9/docs/news.rst#current-release --- .../python-modules/psycopg/default.nix | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/pkgs/development/python-modules/psycopg/default.nix b/pkgs/development/python-modules/psycopg/default.nix index 11b0a4a52c82..f2678ab25d0f 100644 --- a/pkgs/development/python-modules/psycopg/default.nix +++ b/pkgs/development/python-modules/psycopg/default.nix @@ -26,21 +26,21 @@ , sphinx-autodoc-typehints # tests +, anyio , pproxy -, pytest-asyncio , pytest-randomly , pytestCheckHook }: let pname = "psycopg"; - version = "3.1.8"; + version = "3.1.9"; src = fetchFromGitHub { owner = "psycopg"; repo = pname; rev = "refs/tags/${version}"; - hash = "sha256-VmuotHcLWd+k8/GLv0N2wSZR0sZjY+TmGBQjhpYE3YA="; + hash = "sha256-yRb6yRpX1vDmXpYu4O50MYMpP2j75aSqhXCWMF1xVH0="; }; patches = [ @@ -49,15 +49,10 @@ let libpq = "${postgresql.lib}/lib/libpq${stdenv.hostPlatform.extensions.sharedLibrary}"; libc = "${stdenv.cc.libc}/lib/libc.so.6"; }) - (fetchpatch { - name = "cython-3.0.0b1-compat.patch"; - url = "https://github.com/psycopg/psycopg/commit/573446a14312f36257ed9dcfb8eb2756b69d5d9b.patch"; - hash = "sha256-NWItarNb/Yyfj1avb/SXTkinVGxvWUGH8y6tR/zhVmE="; - }) ]; baseMeta = { - changelog = "https://github.com/psycopg/psycopg/blob/master/docs/news.rst"; + changelog = "https://github.com/psycopg/psycopg/blob/${version}/docs/news.rst#current-release"; homepage = "https://github.com/psycopg/psycopg"; license = lib.licenses.lgpl3Plus; maintainers = with lib.maintainers; [ hexa ]; @@ -175,8 +170,8 @@ buildPythonPackage rec { ''; nativeCheckInputs = [ + anyio pproxy - pytest-asyncio pytest-randomly pytestCheckHook postgresql From 66d4106a41b82bbe32b2fce3d5883af1e9d0fd7a Mon Sep 17 00:00:00 2001 From: Martin Weinelt Date: Wed, 3 May 2023 13:04:51 +0200 Subject: [PATCH 2/2] python310Packages.psycopg: Test against a live postgresql instance provided by postgresqlTestHook. Extends our test coverage on Linux from 250 to over 4000 tests, that run in a reasonable time. --- .../python-modules/psycopg/default.nix | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/pkgs/development/python-modules/psycopg/default.nix b/pkgs/development/python-modules/psycopg/default.nix index f2678ab25d0f..a61468b5eaca 100644 --- a/pkgs/development/python-modules/psycopg/default.nix +++ b/pkgs/development/python-modules/psycopg/default.nix @@ -30,6 +30,7 @@ , pproxy , pytest-randomly , pytestCheckHook +, postgresqlTestHook }: let @@ -165,10 +166,6 @@ buildPythonPackage rec { pool = [ psycopg-pool ]; }; - preCheck = '' - cd .. - ''; - nativeCheckInputs = [ anyio pproxy @@ -176,9 +173,21 @@ buildPythonPackage rec { pytestCheckHook postgresql ] + ++ lib.optional (stdenv.isLinux) postgresqlTestHook ++ passthru.optional-dependencies.c ++ passthru.optional-dependencies.pool; + env = { + postgresqlEnableTCP = 1; + PGUSER = "psycopg"; + }; + + preCheck = '' + cd .. + '' + lib.optionalString (stdenv.isLinux) '' + export PSYCOPG_TEST_DSN="host=127.0.0.1 user=$PGUSER" + ''; + disabledTests = [ # don't depend on mypy for tests "test_version"